Product Chat / conversation system, any questions about GGMax

Author
Message
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 21st Feb 2020 21:41 Edited at: 23rd Feb 2020 19:05
Hi
I am working on a conversation system that can be used by anyone, regardless of the amount of npcs you want to use.
The idea is to work with characters created with the new CC with the added lip-sync function, plus tts.



LIMITATION
Each npc can only use 6 audio files (voices), 3 player questions and 3 npc answers. At the moment I think 6 voices are fine.

HOW DOES IT WORK
1- sprite - a gradient gray bar when not visited and orange gradient when it is already visited.
2- 1 text file that will contain all the questions and answers, plus the name of the npc.
I use 1 file named "convo_list.txt" and other one named " convo_audio.txt" in the video:

convo_list.txt



This file will be used by the script to load all the dialogs in a table, which will then be used to show the dialogs in their respective sprite.
So does not matter which questions you do, or how many npcs you want to use for.

3- 1 text file that will contain all the paths of the audio files (voices) in a table, which will then be used to load all sounds into GG.

convo_audio.txt



IMPORTANT
You must respect the naming convention and the files structure.
Q1
Q2
Q3
Note that the numbering is correlative, so do not call your sound file "MySound".

Also note the "name = ornakus" tag as a block start, if we divide the file into blocks; each block = 1 npc, 6 phrases, and 6 sounds (voices).

UNFRIENDLY NPC
Those are the tipical char in a game than does no have nothing to say, or simply they won't talk with the player.

Now I'm going to give a go to pair ideas I've, random answers and derivative ones.

QUESTIONS

As I've pointed above, the goal here is this code working on GGMax and with the new CC lip-sync chars, and this raise the questions, such as:

1- I guess I will be able to enter dialog text in a textbox or something like that, and GGMax will create audio .wav file named by me, and store them let's say, in the audiobank folder, is that correct?

2- Will the audio file be attached to the npc automatically, or will it have to be activated by a script?

3- There is the possibility that I can use my own audio file with an npc created with GGMax CC.
Given that CC will use the microsoft voices to create the animation of the character, could I then change the audio file for mine?

4- Once I have the character created, animated, and with lip-sync applied, I have a question:
Normally a conversation occurs between two or more people, for example between an npc and the player, here the question arises:

For example, the player asks: Do you know how I can get to the castle?
NPC replies: You follow this path and it will take you to the castle.

How can we assign the dialogs to the player?

5- how many sounds (voices) can we assign to a character created with CC?

This depends on the approach I have to give to the convo system.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Feb 2020 22:33 Edited at: 21st Feb 2020 22:34
You can attach audio files to entities on the fly using the Lua command SetEntityString() btw.

For example:



That's part of the script for GraPhiX playable piano btw.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 21st Feb 2020 22:46
Quote: "You can attach audio files to entities on the fly using the Lua command SetEntityString() btw."

Cool, missed that lua command, I'm going to give a go. Another uncommented lua command? I can't find it in global.lua.
How Many sounds can you attach using that way?
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Feb 2020 22:52
Each entity has 5 sound slots numbered 0 to 4.

It is in global.lua, at least it's in my copy of it.

There is also a GetEntityString command which is useful to check if a sound is already loaded.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 21st Feb 2020 23:42
You are right, I was looking for it incorrectly, now I have found the two commands, and I will give them a chance.
Ty ames for the tip.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Feb 2020 23:51
Be aware that the command will load a file from disc into memory so make sure the sound loading is done at an appropriate time when it won't effect FPS, i.e. during switch to a new level or whilst the player is reading something.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 22nd Feb 2020 00:57
I am finding a problem with this method and it only allows me to load 5 sounds per npc, and I need a minimum of 6 per npc atm, and if I decide to expand it, maybe more.

With my method the sounds are loaded at the beginning of the script using the txt file, and I can load as many as I want, although at the moment I am only assigning 6 sounds (voices) for each npc.

The idea is that this is not a customized conversation system only for a specific game, the idea is that anyone can use it with their own dialogs and audio files.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Feb 2020 11:48
Load sounds needed all the time in slots 0-3 and use slot 4 for one-shot sounds, then simply load the next one-shot sound on the fly as needed.

That way the conversations can be virtually endless.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 23rd Feb 2020 19:17
Quote: "Load sounds needed all the time in slots 0-3 and use slot 4 for one-shot sounds, then simply load the next one-shot sound on the fly as needed. "

I guess Lee doesn't have the answers to my question yet, so meantime I'm going to try your way with random Q&A.
Idea is allow "unfriendly" chars getting random questions and giving random answers as well, so no allways is the same.

Note: I've added a pair of questions, on the main post.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 23rd Feb 2020 21:27
Maybe global sounds would be best. That way you can load as many as you need (memory permitting) and you just need to assign them in script somehow. Belidos did a quest script that read info in from the entities name (or something similar). Might be a way to do this in a (reasonably) easy fashion, on the end users part. It was pretty neat from what I recall
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 23rd Feb 2020 23:49
@ DVader
Using global sounds so far, even in the video, and it is giving me a good result, I'm glad till now, just need answers when be possible.

I already got unfriendly random Q&A, I'm going to try derivative questions.

That kind of questions and answer than coming depending what player has asked before.
Maybe some user want to use it in their map, so I want to try to provide that function, if posible.

In want to dive too into other kind of Q&A.
Do you remember the char in the bar, that man have some info, but that man want some money, so what's when player back with the money?
He will need something to say, therefore alot of work coming soon.

@ Lee
As you can see I've enought to be busy right now, so you please follow your roadmap, and bright us outstanding tools to work with.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 24th Feb 2020 03:31
Here is the answer to the original post, sorry for the delay, been crunching last week and same again this week. Sooo much to do

@3com : Your answers:
1. There is a text box in the character properties (four slots right now), and when you enter text the system automatically generates the WAV based on the voice and rate you select, and also generates the lip sync data. As soon as you run a script that uses that slot to 'speak' your character talks, gestures and lipsyncs.
2. Any TTS (text to speech) stuff is stored on a per-level basis, and you will see the unique file created for it in your character properties. It's smart enough to re-use WAV audio from identical TTS texts just in case you have an army all saying 'go away'
3. You have three options for character speech. Use a WAV, use TTS to generate a WAV or record your own voice right inside the software and use that. Simples. Using your own Microsoft Voice set, sure if you install it, but I have had a hard time finding out (a) how to make them and (b) where third party libraries are that we can use. My gut feel is that this is old tech, and online cloud based TTS is the future (but not for September!).
4. It must be made clear there will be NO conversation engine functionality added to MAX. I am just upgrading the options for getting speech into the game, but all the clever stuff still needs to be done in LUA script.
5. There are four slots right now, but I am in consultation with some scripter babies and I imagine the pressure will be on to avoid fixing this number, and letting scripts have as many slots as they need. Time will tell. Right now it's four.
PC SPECS: Windows 10 64-bit, Intel Core i7-8700K, NVIDIA Geforce GTX 1080 GPU, 16GB SYSTEM RAM

fearlesswee
5
Years of Service
User Offline
Joined: 30th Aug 2019
Location: United States
Posted: 24th Feb 2020 08:01
@Lee
I think keeping the TTS offline would be for the best, in this ever "always-online, always connected" world I often find myself staring at a "CONNECTION FAILED" screen or buffering icon more than I care to count

Also, having unlimited slots for a character's voice would be awesome and let us make endless dialog systems. As long as the engine will allow us, we can do most of these feature requests ourselves in Lua
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 24th Feb 2020 19:04
@ Lee

Quote: "There is a text box in the character properties (four slots right now), and when you enter text the system automatically generates the WAV based on the voice and rate you select, and also generates the lip sync data. As soon as you run a script that uses that slot to 'speak' your character talks, gestures and lipsyncs."


Really cool Mr. Lee.

Quote: " Any TTS (text to speech) stuff is stored on a per-level basis, and you will see the unique file created for it in your character properties."


Pretty useful file, Coming in handy to load sounds via globalSounds()



Quote: "You have three options for character speech. Use a WAV, use TTS to generate a WAV or record your own voice right inside the software and use that."


It looks like some MS narrator are unable, and you has to active them via "Regedit" , I most likely end up using my own wav files, atleast till cloud comes.

Quote: "It must be made clear there will be NO conversation engine functionality added to MAX. I am just upgrading the options for getting speech into the game, but all the clever stuff still needs to be done in LUA script."


Well, so I'll has till september to do my best. LOL

Quote: "and I imagine the pressure will be on to avoid fixing this number, and letting scripts have as many slots as they need."


That would be fantastic! This would open other ways of approaching the situation.

Thanks a lot for the useful inputs.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
dedser
9
Years of Service
User Offline
Joined: 19th Mar 2015
Location: mexico
Posted: 26th Feb 2020 07:34
I would love to have Game Guru Max have visual scripts
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 26th Feb 2020 20:27 Edited at: 26th Feb 2020 20:30
Quote: "A challenge in the design of computer games is writing, organizing, and testing non-
linear dialog involving multiple user options and branches to many different possible character
responses."


This tool does not even try to cover all the aspects that this boy describes here.
To achieve this level of operation, the conversation system should be integrated into the engine, and be developed with C or C ++.

Quote: "Authoring dialog for video games is a considerably more complex writing task than
creating the script for a movie or television program. The process of a conversation is nonlinear
and cannot be captured as a simple script. Rather than a simple linear progression of topics, the
game instead seeks to convey a set of scenes, themes, or ideas. Even if the NPC has only one
path in the conversation, the player must have options from which to choose, so that the game
creates the illusion of influencing story progression. Hence, the dialog must be described in a
more complex format than a script. "


The purpose of the convo system is to handle the dialogs in a simple and easy way for the user.

First I wrote a script that handled the dialogues of all the npcs, but the script began to grow exponentially, so I decided to write a script to cover each case; This will make it easier for me to find / isolate / fix, a possible error. In addition, the user will not have to execute a large number of routines that he probably does not need.

What I have so far:

Script1 - covering simple convo between player and npc.
Script2 - covering an unfinished conversation.
Script3 - Covering those cases in which depending on what the player asks, the conversation generates new questions and answers, that is, the conversation is branched.

Right now I am working on script3 and I have to confess that I am a little lost, but I try to improvise in order to perform some tasks without the right tools.

Due the Lee's imputs on this thread, I've decided to go using CC system and working with npc> properties panel> sound slots.
AmenMoses was right and is perfectly doable in that way. Ty AM

I'll come with a vid as soon as possible.

@ Lee
If we have to handle the npc's inputs (audio files) we end up needing some sort of "GetGlobalSoundPlaying ()" something such as isSoundPlaying (e, slot).
Code has to wait the player sound finnish before play the next one (npc input); I already know about workarounds using timer as example, but This command would be like a easy life maker and time saver.
How to long the pause between one sound and the next, should be? most likely you must need to know the wav file size, and how to ask this via lua?

GetTimer (e) <s_timed [e] + 4000, does not work for every wav files due it could be size based.
Do you notice how "isSoundPlaying (e, slot)" would be a time saver.

I wonder if GGMax will create a txt / dat per-level file with all the dialogs, this would help the code to find out the sixth answer.

I explain myself: In the properties of the npc you have:

sounset
sound1: your file wav here
sound2
sound3
sound4

This is equal to 5 slot, so code need to ask somewhere the input number 6, and a txt file might help.

Talking you about it, because convo system will allow 6 audio files as 3 player's inputs and 3 npc's outputs, at leats so far, waiting for infinite sound slots.

source

Edit: I've missed source link, already added.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM

Login to post a reply

Server time is: 2024-11-23 20:09:00
Your offset time is: 2024-11-23 20:09:00