Product Chat / Speech Tutorial

Author
Message
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Jul 2019 18:59 Edited at: 19th Jul 2019 19:02
Hi everyone. It seems this is something that people want at the moment so I thought I'd update my old speech tutorial to include animation.

Here is the code.

If this is helpful, please leave a like and comment on the video. It will help it get out to more GG users and of course help my channel a little.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 19th Jul 2019 19:43
Thank you DVader , this would help a lot.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 20th Jul 2019 02:41
Nice. Thanks for the info. This works on about any stock character?

PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 20th Jul 2019 03:02
Yeah, for sure GG needs many more neutral characters.
Their faces don't need to animate so much but arms would do!!



PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 20th Jul 2019 11:20
You could just adapt the ones from the sci fi pack

The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 20th Jul 2019 16:54 Edited at: 20th Jul 2019 16:56
Quote: "Nice. Thanks for the info. This works on about any stock character?"

It should work with any of the Default soldiers included with GG. Any character that has a default rig and animations. If other characters have a talk anim it could be adjusted to work with them as well. It's just a matter of finding out those frame values.

There's way more anims than I showed here for talking, I just grabbed what looked right for the short sentences here. There is quite a bit of arm waving and such available, just try increasing the anim range I set for talking. I notice the video above shows them
So change 3260 to 3360 etc to view a longer animation. You should be able to go to 3600 or so maybe a little higher. You can also start the animation further in if you want it to start differently.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 21st Jul 2019 00:26 Edited at: 21st Jul 2019 00:28
ok i have made a small script but it does not want to work correctly


Ok the code is suppose to loop some animations then it generates random numbers between 1 and 7 and as soon as the number is one then the code must loop another couple of animation frames and after that then go back to the first. but it get stuck as soon as it generates number one.
Maybe someone can tel me how to fix this.
Thank you
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Jul 2019 09:20
When the animation is finished change rd to not be 1 anymore otherwise counter never gets increased
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 21st Jul 2019 10:43
Thanks smallg will check again.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 21st Jul 2019 11:48 Edited at: 21st Jul 2019 14:23

as can see in the script the animation is not fluent but ok for now.
So its almost perfect, but not realy.
in the video the script first plays animation frames (3000,3100)
then after a random time / number (1) then it plays (3429,3700)
and after that is goes back to (3000,3100)
and then loops again.
The script is not perfect as sometimes it does not play when it gets the random number, and sometimes it does.
i would be very great full if any one can make it perfect and if possible make the animation as smooth as possible also.

Thanks
Pcs
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Jul 2019 13:08


Something like that?
Been there, done that, got all the T-Shirts!
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 21st Jul 2019 14:00
That's Brilliant !!
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 21st Jul 2019 14:25
Very awesome AmenMoses.

Question:
i need the Npc to stay in an loop animation so that it looks like he is alive and not just when the action animation come to play and then go to a dead stand still again , or would that not be possible now?
There is a smooth animation frame between 3000 to 3100 but its difficult to line the other animation up with it again.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Jul 2019 14:40
I did that about 3 years ago now but IIRC I had a great deal of trouble finding small sequences that fitted together smoothly, was a lot of trial and error I can tell you!

The attached may help if you don't already have it.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Jul 2019 19:22
Quote: "I did that about 3 years ago now but IIRC I had a great deal of trouble finding small sequences that fitted together smoothly, was a lot of trial and error I can tell you! "

that's something i love about unity, the animations can blend smooth as butter from one to the other because it lets you set the transition positions and speed manually (i.e. when to start blending from your current animation and how quickly it should move the bones into your desired animation), and as you're using the same character rig for each animation it just moves the bones gradually from 1 animation to the next - not an instant jump like GG currently handles it (though instant jumps are still possible of course)... would be a great future feature for GG
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 21st Jul 2019 20:41 Edited at: 21st Jul 2019 23:43
I'm sure it's not that critical here, but if you are looking to get random
numbers each time, it's suggested that a random seed call is made before
the randomizer. That often uses the timer because specific numbers
will always return the same random seed. This has nothing to do with
your wait time, jut a more random sequence to your animations.

Looks like; math.randomseed( os.time() )

You could in fact throw out the random 1-10 and wait for 1 part, and instead do
something like a random wait between 20-40 second (choose your own time here).
That way you know that the fidget will always happen between that time frame.
Just randomize the wait time -- something like this;

--**--flag that normal animation is occurring--**--
math.randomseed( os.time() )
fidget_delay[e] = (math.random(1,20) * 1000) + 20000 -- this returns 20-40 seconds
if GetTimer(e)>fidget_delay[e] then
--**-- flag for fidget and not normal animation--**--
----- go go go inspector gadget! Er, I mean fidget soldier, fidget!
----- reset timer and etc, go back to normal stance--- repeat
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 21st Jul 2019 21:25
You could add an idle animation in-between the speech here, I only bothered to add it at the end. You will always get a slight jump when switching, unless you spend a lot of time on it. Especially given the basic nature of Game Guru's animation commands. If the animations exist to transition from anim to anim, it's possible to do You would have to start checking frames before starting the new anim to get as seamless as is possible.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 22nd Jul 2019 13:58
Thanks to all for the info.
Maybe the best way is still to do it as Amenmoses did it, and let the NPC characher only do animation wen needed.

Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 22nd Jul 2019 18:39
Thanks DVader. Great information!
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 23rd Jul 2019 14:35
@ Pink Panther thanks, I hope it is a good beginning for you to use.

@ PCS Seriously all he did was take some time to find the animations out. A little time and effort is all that is needed here.

Sometimes I wonder why I bother. You can't just hand out ice lolly's round here, it seems you have to sculpt them to perfection first
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 23rd Jul 2019 15:11
@DVader , hi i was not complaining merely stated that it s difficult to get the animations to line up ,

I did get an smooth idle animation going, witch i am using now,

but at that time id not got it right because the of the moving hand or fidge animation does not line up nicely. that is why i asked this question to AmenMoses:
Quote: "i need the Npc to stay in an loop animation so that it looks like he is alive and not just when the action animation come to play and then go to a dead stand still again , or would that not be possible now?
There is a smooth animation frame between 3000 to 3100 but its difficult to line the other animation up with it again. "


But i am fine now,
So thank you, you can keep your ice lolly..

Again Thanks to every one that gave an input to this.

(Ps most of the time it feels like one is wasting some peoples time in asking some question. )


Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 23rd Jul 2019 18:57 Edited at: 23rd Jul 2019 18:58
Like this?



Getting speech is not too hard, problem is to get facial + lips anims. It would be nice to have.
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
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 23rd Jul 2019 19:03
Quote: " You can't just hand out ice lolly's round here,"

Cornetto please when your ready mate
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 23rd Jul 2019 19:14
@3com very cool video. looks awesome
@synchromesh lmao. lol.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 23rd Jul 2019 19:17 Edited at: 23rd Jul 2019 19:39
@ PCS. My only point was the main work is done here. You just need to spend some time playing around with animation ranges. Use the ai_viewanimations script included with GG, to run through them, find the values you want, then just change them in the script. It can be laborious getting it perfect (or as close as you can get) without doubt (there's a ton of duplicate anims for different weapons and such), but if you want it to look flawless either you need to do the work or find out the anim ranges from somewhere.

Questions are fine. We all need to learn. Perhaps I have misread the comments, and overreacted a little. I was a bit put out when you posted a completely different script to the one I have provided here though. That belongs on your own thread really, yeah it's related, but it's not the script I have posted here. Questions relating to the script I provided are fine, but I don't feel the need to debug everyone else's.

Still, I'm glad you got your script working as you want now. You just have to beware about us artistic types on occasion Not that my post was particularly bad, I trying to say the building blocks are there, up to you to sculpt the details in.

Edit - @Syncromesh - Can't afford a Cornetto mate, you will have to make do with a cheap clone That's high on yellow dairy and small on cone ;p No ice cream emotes here.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 23rd Jul 2019 19:52
@DVader point taken.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 23rd Jul 2019 21:14
@PCS. No probs. I can understand the urge to try to get info as fast as possible

@ all. I am at a loss as how to make it easier to follow though. Am I too fast (trying to keep length down)? Is my accent an issue? Is the code too small to see easily? I'd like to improve my tutorials and make them as useful as possible. If you haven't guessed, I'm not a natural at this sort of thing and am very rusty indeed of late.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 23rd Jul 2019 22:02
@DVader
i have some nice animations now were Npc sit in chair and then stand up and then fidge, and it looks nice and smooth , 4 different animation , but they run nice, will up load video in own post when i add prompt's with text on screen talking, to go with it.
Thank for all the help.

Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 24th Jul 2019 14:05
I did this a few years back

I got a fair bit further, but certain bugs and DX11 upgrades breaking media broke it a little. The boatman talks, fidgets and sits down This was before I added a voice over to it.
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: 24th Jul 2019 15:16 Edited at: 24th Jul 2019 15:16
I can remember it. Nice vid mate.
We cant do all we want to, but we can do woderfull thinks.
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
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 24th Jul 2019 16:32
yes it looks very good.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

Login to post a reply

Server time is: 2024-11-24 00:45:15
Your offset time is: 2024-11-24 00:45:15