WEBVTT

00:07.350 --> 00:08.490
Welcome back.

00:08.580 --> 00:11.220
Now we have our electrocute effect.

00:11.220 --> 00:14.070
So far it's looking pretty good.

00:14.070 --> 00:15.560
We don't have the beam yet.

00:15.570 --> 00:17.670
It's also quite silent.

00:17.850 --> 00:22.410
I'd like to play a sound, and I'd like to use a gameplay cue for that.

00:22.410 --> 00:29.580
And in doing so, I'd like to take a little bit of a deeper dive into how our project handles gameplay

00:29.580 --> 00:30.930
cues in general.

00:31.080 --> 00:36.450
So here in The electrocute, I'm going to make a new blueprint, and we're going to choose Gameplay

00:36.450 --> 00:43.110
Cue notify, and we're going to choose static, just like we have for the cue that we're using for the

00:43.110 --> 00:45.420
blood particles and sound on the enemy.

00:45.450 --> 00:52.830
We're going to select that and we're going to call this GC underscore shock burst.

00:53.670 --> 00:57.450
Now shock burst is a static gameplay cue.

00:57.450 --> 01:06.210
And for static gameplay cues we override the function on execute, and we can plug in target and parameters

01:06.210 --> 01:10.320
into the parent function as we're overriding this.

01:10.470 --> 01:15.270
But really, I just like to get my target, get the location of it.

01:15.270 --> 01:16.880
And this is of course Ora.

01:17.130 --> 01:18.960
I'm going to get actor location.

01:20.640 --> 01:26.610
And I'd like to play a sound at this location, so I'm going to use play sound at location.

01:30.170 --> 01:31.970
And the sound I'd like to play.

01:31.970 --> 01:36.350
Well, we can take a look at content, assets, sounds.

01:36.990 --> 01:42.180
And abilities and there's a shock with SFX shock.

01:43.440 --> 01:48.930
There's also a shock loop and we'll get to that later, but I'm going to use SFX shock right here.

01:48.930 --> 01:52.980
It's just going to be hardcoded right in and I'm going to hook up.

01:54.040 --> 02:00.640
On, execute and hook up, play sound at location two, the return node and we have a basic shock burst

02:00.640 --> 02:01.810
gameplay queue.

02:01.960 --> 02:06.070
Now this queue needs to be associated with the gameplay queue tag.

02:06.160 --> 02:11.160
So if we look in class defaults, we can choose a gameplay queue tag.

02:11.170 --> 02:17.260
I don't have a gameplay queue for Shock Burst, so I'm going to go to Project Settings and just add

02:17.260 --> 02:18.550
one here in the editor.

02:20.170 --> 02:27.220
So going to gameplay tags, we have our gameplay queue, we have melee impact.

02:27.220 --> 02:28.330
I'm going to add a new one.

02:28.330 --> 02:31.150
Gameplay queue dot shock burst.

02:32.620 --> 02:40.390
Now our gameplay cue tag has shock burst, and if we go back to Shock Burst, we can give it the shock

02:40.390 --> 02:40.990
burst tag.

02:40.990 --> 02:44.730
Notice we can't choose anything else that's not a gameplay cue tag.

02:44.740 --> 02:50.470
So now that this has the shock burst tag, we can activate this gameplay cue.

02:50.590 --> 02:55.990
I'd like to go back to electrocute, so let's go into a electrocute.

02:56.720 --> 02:59.480
I'd like to make this on execute.

02:59.480 --> 03:00.770
Get called.

03:00.890 --> 03:05.750
So here in electrocute, as soon as we've updated the facing target.

03:05.780 --> 03:09.410
We can do this even before just before playing the montage.

03:09.440 --> 03:16.700
We can execute a gameplay cue by using execute gameplay cue on owner.

03:17.000 --> 03:20.930
And if we do this, of course, Shock Burst has this.

03:20.930 --> 03:26.240
My target, which will be the owner or the owning avatar.

03:26.270 --> 03:28.940
This function handles setting that for us.

03:28.970 --> 03:31.250
We do have to choose the gameplay cue.

03:31.280 --> 03:37.490
We're going to choose Shock Burst for this, and we can go ahead and just call this function like this.

03:38.680 --> 03:46.270
And if we go into shock burst and we just print the name of my target so we can use get object name.

03:48.180 --> 03:50.070
And we can use a print string.

03:52.520 --> 03:56.030
We can print the name of this.

03:56.030 --> 03:57.300
My target.

03:57.320 --> 04:01.160
So if we go back now, we hear that sound.

04:01.160 --> 04:05.210
We're printing the name if we try this in multiplayer.

04:10.200 --> 04:12.990
Setting it to number of players to two.

04:13.900 --> 04:15.940
And we try this on the client.

04:16.630 --> 04:17.890
It works as well.

04:24.880 --> 04:26.910
That's the magic of gameplay cues.

04:26.920 --> 04:32.260
So now we have a gameplay queue to handle that starting sound great.

04:32.650 --> 04:40.780
Now if you take a look at your output log, you may notice that there's a warning pretty far up somewhere.

04:41.550 --> 04:43.380
Looking for yellow text here.

04:43.410 --> 04:44.070
Warning.

04:44.070 --> 04:44.810
No gameplay.

04:45.060 --> 04:49.020
Notify paths were specified in default game ini.

04:49.050 --> 04:51.570
Under and it even tells you.

04:52.300 --> 04:52.880
Script.

04:52.900 --> 04:53.280
Gameplay.

04:53.290 --> 04:53.810
Abilities.

04:53.830 --> 04:54.220
Ability.

04:54.250 --> 04:54.640
System.

04:54.640 --> 04:55.490
Globals.

04:55.510 --> 04:59.080
It says falling back to using all of game.

04:59.620 --> 05:03.070
It even goes on to say this may be slow on large projects.

05:03.100 --> 05:06.520
Consider specifying which paths are to be searched.

05:06.640 --> 05:14.020
You see, we're executing a gameplay queue by gameplay tag, and the gameplay queue manager has to search

05:14.020 --> 05:23.500
our entire project for the gameplay queue notify Shock Burst that has this gameplay queue tag, but

05:23.500 --> 05:29.950
we can make this a little bit more optimized by keeping our gameplay cue notifies in one folder or a

05:29.950 --> 05:31.930
small number of folders.

05:32.200 --> 05:37.810
So we could go into ability system and just have one folder for our gameplay cue notifies.

05:37.840 --> 05:43.900
This is an optimization that allows the gameplay queue manager to not have to search all of these folders.

05:43.990 --> 05:46.660
So what we would do is create a new folder.

05:46.660 --> 05:51.310
I'm going to put it in blueprints ability system and call this gameplay queue.

05:51.730 --> 05:53.080
Notify size.

05:54.350 --> 05:58.040
And we can move all of our gameplay cues into this.

05:58.310 --> 06:07.670
So if I have my blueprints ability system, gameplay cue notifies folder available here, then I can

06:07.670 --> 06:10.760
browse to GC Shock Burst.

06:11.880 --> 06:14.820
And I can drag that into my gameplay cue.

06:14.820 --> 06:15.900
Notifies.

06:16.940 --> 06:18.470
And I can move it there.

06:19.140 --> 06:27.240
Now we also have another gameplay cue if we go to Ability System Enemy cuz we have GC melee impact.

06:27.270 --> 06:34.140
Now if you don't want them all in the same folder, we can specify multiple paths and we'll see how.

06:34.260 --> 06:39.810
But if we want one path and we want it to be as optimized as possible, we can put all of our gameplay

06:39.810 --> 06:42.900
cue notifies right there in gameplay cue notifies.

06:42.900 --> 06:44.550
We can move that there.

06:44.550 --> 06:46.560
I can delete that, cuz.

06:46.560 --> 06:51.360
And now we know all of our gameplay cue notifies are here, and we can tell the gameplay cue manager

06:51.360 --> 06:53.400
look, you don't have to search the whole project.

06:53.400 --> 06:54.540
Start here.

06:54.870 --> 06:56.310
So how do we tell it that?

06:56.310 --> 06:59.820
Well, that warning told us where to go.

06:59.850 --> 07:01.830
We're going to close our project.

07:02.450 --> 07:04.790
We're going to find our config folder.

07:04.790 --> 07:07.880
And where did that warning tell us to look.

07:07.910 --> 07:10.610
It told us to go to default gaming and I.

07:12.370 --> 07:16.360
And to add something here under ability system globals.

07:16.360 --> 07:22.990
Now we already have it here because we set our aura ability system globals as the ability system globals

07:22.990 --> 07:24.130
class to use.

07:24.160 --> 07:32.170
Here is also where we can specify our gameplay cue notifies path so we can add that path with plus and

07:32.170 --> 07:40.960
we can say gameplay cue, notify paths equals and we can provide the path we start with game.

07:40.960 --> 07:43.330
This takes the place of the content folder.

07:43.330 --> 07:45.670
So our folder is what comes after that.

07:45.670 --> 07:53.380
We had blueprints ability system slash gameplay cue notifies.

07:53.830 --> 08:00.490
Now if we had say kept that other folder where we had our enemies gameplay cue, we could have added

08:00.490 --> 08:01.210
that too.

08:01.240 --> 08:07.300
We could add blueprints, ability, system, and whatever other path here that we want.

08:07.330 --> 08:13.810
We can have multiple paths here, that's fine, but we can also have them all in the same folder right

08:13.810 --> 08:14.050
here.

08:14.050 --> 08:15.520
Gameplay cue notifies.

08:15.520 --> 08:16.720
That works too.

08:16.840 --> 08:19.780
So that's the first thing I'd like to do a deep dive on.

08:19.780 --> 08:22.180
Now we have our cue notifies set.

08:22.330 --> 08:25.720
Now there's another thing I want to bring to your attention.

08:25.810 --> 08:27.310
I'm going to hit debug.

08:28.340 --> 08:31.730
I'll go ahead and let those asset editors open again.

08:31.730 --> 08:35.900
And I'm going to execute a gameplay queue.

08:35.900 --> 08:43.370
But first I'm going to come back into rider and do a project wide search for max RPC per net update

08:43.370 --> 08:50.450
and go into Gameplay Queue manager CP and place a breakpoint right here and check for too many Rpcs.

08:50.480 --> 08:58.730
You see, there's a max number of rpcs, and our gameplay queues are replicated as rpcs, and there's

08:58.730 --> 09:02.120
a limit to how many that can be sent per net update.

09:02.150 --> 09:07.970
I'd like to see what that limit is by placing a breakpoint and coming back in here and right clicking

09:07.970 --> 09:11.240
now that's going to execute that gameplay queue.

09:11.240 --> 09:16.220
And if we check out this variable, we see that it's an eye console variable.

09:16.220 --> 09:18.530
Right here we see two.

09:18.560 --> 09:23.270
So if we expand it and show data we see shadowed value.

09:23.300 --> 09:24.710
There's two elements in it.

09:24.710 --> 09:26.450
And they're both set to two.

09:26.690 --> 09:29.720
That's the number of rpcs that can be sent.

09:29.720 --> 09:33.140
That's the number of gameplay queues that can be sent per net update.

09:33.140 --> 09:34.460
And that's kind of low.

09:34.460 --> 09:36.200
And we can override that.

09:36.230 --> 09:41.150
Now we don't want to override it to a huge number like a thousand, but two is a bit low.

09:41.180 --> 09:42.890
We can go up to about ten.

09:42.920 --> 09:45.350
The Lyra game project sets it to ten.

09:45.350 --> 09:47.210
Well, how do we set it?

09:47.240 --> 09:53.240
Well, notice that this is a console variable and we can set console variables for our project.

09:53.240 --> 09:59.120
So what I'm going to do is hit stop and back to our config folder.

09:59.270 --> 10:02.930
This time I'm going to go into default engine ini.

10:03.320 --> 10:09.980
And we can set console variables by using square brackets and typing console variables.

10:10.940 --> 10:12.590
And we can add one that's.

10:12.620 --> 10:20.090
Net all lowercase dot max rpc per net update.

10:20.240 --> 10:22.460
We can set that to a value.

10:22.460 --> 10:25.280
Now like I said Lyra uses ten.

10:25.310 --> 10:27.620
We can use ten, and ten is plenty.

10:27.650 --> 10:30.140
You really don't need more than ten, trust me.

10:30.140 --> 10:35.430
And if you do need more than ten, you should rethink your strategy and your design, right?

10:35.450 --> 10:38.630
Because that's too many rpcs per net update.

10:38.660 --> 10:40.850
We've got to be kind of sparing with them.

10:40.850 --> 10:45.950
That's kind of why we don't use gameplay cues for just everything that we could.

10:45.980 --> 10:48.770
We use them for things that we have to use them for.

10:48.860 --> 10:54.890
So now that we've set this to ten, we can save and close that and we can run in debug mode again.

10:55.980 --> 10:59.730
And we can press play and we can activate our ability by right clicking.

10:59.730 --> 11:03.270
And I removed my break point.

11:03.270 --> 11:06.030
So I'm going to put it back and right click.

11:06.530 --> 11:08.560
And take a look at the value here.

11:08.600 --> 11:13.910
Now we see that we have ten instead of two went from 2 to 10.

11:13.940 --> 11:14.720
Great.

11:14.870 --> 11:17.540
So now we can accommodate for more gameplay cues.

11:17.540 --> 11:19.880
But again this is per net update.

11:19.910 --> 11:26.560
Net updates are not as often as say, the tick function by any means, but they're not slow either,

11:26.570 --> 11:27.530
right?

11:27.740 --> 11:34.130
We could be receiving net updates 60 to 100 times per second, depending on bandwidth and what's going

11:34.130 --> 11:35.060
on in the game.

11:35.060 --> 11:37.640
So you don't need more than ten.

11:37.640 --> 11:42.830
Ten is actually probably overkill, but at least now we don't have it set to two, which is kind of

11:42.830 --> 11:44.150
ridiculously low.

11:44.960 --> 11:48.740
Okay, so I'm going to go ahead and go into gameplay.

11:48.740 --> 11:53.840
Cue notifies open my shock burst, and I don't want to print a string anymore.

11:53.870 --> 11:56.210
I just want to hear that sound.

11:56.210 --> 11:58.340
And that sound is sounding great.

12:00.510 --> 12:07.230
And the sound takes a little bit longer than my montage seems to.

12:07.980 --> 12:08.810
Allow.

12:08.820 --> 12:15.720
So I think I am going to go into my cast electrocute montage and set the rate scale a little bit slower.

12:15.750 --> 12:18.660
Not much 0.75 should do it.

12:21.780 --> 12:24.120
Maybe even 0.6.

12:28.470 --> 12:28.860
Yeah.

12:28.860 --> 12:29.700
That's better.

12:36.870 --> 12:44.100
And now that it's a little slower, we can blend in a little slower, we can blend in even 0.2 or 0.3.

12:44.790 --> 12:46.110
Yeah, that looks good.

12:48.900 --> 12:53.250
I might even go back down to 0.5 for the rate scale.

12:59.450 --> 13:02.450
And I'm going to zero in on 0.55.

13:02.450 --> 13:04.160
I think that is good.

13:04.190 --> 13:05.450
That's the sweet spot.

13:05.450 --> 13:06.290
Let's hear it.

13:21.060 --> 13:22.800
Yep, that sounds great.

13:23.010 --> 13:31.590
Okay, so now we have another gameplay cue in our project and we're using it in our electrocute ability.

13:31.620 --> 13:33.230
Things are sounding good.

13:33.240 --> 13:35.970
It's time to start making things look good too.

13:36.000 --> 13:37.320
And we'll do that next.

13:37.350 --> 13:38.310
I'll see you soon.
