WEBVTT

00:07.160 --> 00:08.300
Welcome back.

00:08.300 --> 00:11.810
In this video we're going to talk about a new type of gameplay cue.

00:11.810 --> 00:15.860
Notify the gameplay cue notify burst type.

00:16.100 --> 00:22.430
Now if we're going to create a new gameplay cue notify I'd like to place it in ability system gameplay

00:22.430 --> 00:24.920
cue notifies just so we can keep them here.

00:24.920 --> 00:31.640
And before we even go about doing that, we're going to need a gameplay cue tag.

00:31.640 --> 00:34.760
And I can just create this right here in project settings.

00:34.760 --> 00:40.760
I don't feel like I'm going to need a tag for this natively in C plus plus, so I'm going to go to Gameplay

00:40.760 --> 00:41.720
tags.

00:41.720 --> 00:44.300
I'm going to find my gameplay cue tags.

00:45.480 --> 00:47.220
So here's gameplay cue.

00:47.250 --> 00:53.700
I'm going to click plus and get a new gameplay cue tag called Gameplay Cue Dot Arcane Shards.

00:55.060 --> 00:59.980
And with that, I can close project settings and I can make my new gameplay cue.

01:00.010 --> 01:06.160
I'm going to right click create a New blueprint class, and for this class I'm going to search for Gameplay

01:06.160 --> 01:10.930
Cue notify and choose Gameplay cue notify burst.

01:10.930 --> 01:11.410
Why?

01:11.440 --> 01:20.830
Because burst is great for one off gameplay effects such as sounds and things like our shards.

01:20.830 --> 01:22.240
It's going to be perfect for that.

01:22.240 --> 01:27.190
This is a static gameplay cue notify, so it's not instanced.

01:27.190 --> 01:29.020
It cannot hold any state.

01:29.020 --> 01:35.260
We're going to select this and we're going to call this G c underscore arcane shards.

01:35.740 --> 01:43.930
And before we go and start using it I'm going to do a project wide search here for gameplay queue notify

01:43.930 --> 01:45.850
underscore burst.

01:45.850 --> 01:48.730
And here we see the CPP file for it.

01:48.730 --> 01:52.480
And we can go into the h file for it.

01:52.480 --> 01:53.710
And here's the class.

01:53.710 --> 01:54.910
It's not big.

01:54.910 --> 01:56.470
It's kind of small.

01:56.470 --> 01:58.480
It has even an on burst.

01:58.480 --> 02:06.220
That's a blueprint implementable event which we can add our own custom logic to in the blueprint.

02:06.220 --> 02:10.690
And it also has an on execute implementation.

02:10.690 --> 02:15.220
And if we go into it, we see that it's doing some stuff when it's executed.

02:15.220 --> 02:18.760
Here we see things like execute effects.

02:18.760 --> 02:25.900
So it has this burst effects, which as you can see has its own type of gameplay queue notify burst

02:25.900 --> 02:26.650
effects.

02:26.650 --> 02:29.770
Now let's just read the comment above the class.

02:29.770 --> 02:35.890
It says this is a non instanced so static gameplay queue notify for effects that are one offs.

02:35.890 --> 02:41.680
Since it is not instance, it cannot do latent actions such as delays and timelines.

02:41.680 --> 02:46.060
So one offs only one offs and we can't store state in it.

02:46.060 --> 02:50.260
So we can't start something that's looping and then go kill it later.

02:50.260 --> 02:52.300
No, that's not what the burst is for.

02:52.300 --> 02:54.430
The burst is a little bit more basic than that.

02:54.430 --> 03:01.330
So now that we've seen the C plus plus class, let's take a look at the Blueprint Arcane Shards gameplay

03:01.330 --> 03:01.750
queue.

03:01.750 --> 03:02.500
And here it is.

03:02.500 --> 03:09.220
We can see that its details panel is quite plain, and notice that the gameplay queue tag is set to

03:09.220 --> 03:12.850
gameplay queue arcane shards by default.

03:12.850 --> 03:16.030
So that's kind of nifty, a little bit mysterious.

03:16.450 --> 03:22.660
And now that we have our arcane shards, we can decide what happens on burst.

03:22.660 --> 03:27.100
So the first thing I'm going to do is go to functions and override.

03:27.100 --> 03:31.240
There it is on burst and I'm just going to print a string.

03:31.240 --> 03:33.970
Nothing crazy print string here.

03:33.970 --> 03:35.830
That's what we're going to start with.

03:35.830 --> 03:42.340
And the string is going to say arcane shards burst exclamation point.

03:42.340 --> 03:43.600
Because why not?

03:43.600 --> 03:50.650
So the first thing I'm going to do is execute one of these in conjunction with our debug spheres, so

03:50.650 --> 03:56.320
we can go back to arcane shards right here, where we're drawing our debug spheres right at the end,

03:56.320 --> 03:59.140
I'm going to right click and type execute.

03:59.140 --> 04:01.630
And for these bursts we execute them.

04:01.630 --> 04:07.480
We don't add them to actors because those looping queues, those gameplay queue notify actor queues,

04:07.480 --> 04:15.010
those get added to actors, but bursts just get executed and we're going to execute gameplay queue on

04:15.010 --> 04:15.400
owner.

04:15.400 --> 04:17.110
But we can use params too.

04:17.110 --> 04:21.430
I like to pass params through just in case I like to use them.

04:21.430 --> 04:25.870
Of course that means we have to make gameplay queue params, so we'll get to that.

04:25.870 --> 04:31.180
But first we set the gameplay queue tag, we'll set it to arcane shards, and then we'll drag off the

04:31.180 --> 04:32.530
gameplay queue parameters.

04:32.530 --> 04:38.080
We'll make gameplay queue parameters, and we'll pass in just an empty struct for now.

04:38.080 --> 04:42.610
And now our arcane shards has arcane shards burst printed.

04:42.610 --> 04:44.950
Let's see what happens now.

04:45.680 --> 04:50.570
When we save all and press play and go ahead and cast our spell.

04:51.360 --> 04:53.520
There we have our burst message.

04:53.520 --> 04:57.060
So we know that that gameplay queue is being executed.

04:57.060 --> 05:03.540
That's great, but print strings are not the coolest looking thing in the world.

05:03.540 --> 05:04.860
So there's that.

05:04.860 --> 05:11.220
But before we go and start spawning particles and sounds, I want to bring your attention to something

05:11.220 --> 05:12.780
in the class defaults.

05:12.780 --> 05:19.590
If you open the class defaults and we bring our details panel out a bit, you'll notice we have burst

05:19.590 --> 05:20.430
effects.

05:20.550 --> 05:26.100
And remember in Burst effects in the C plus plus class, we saw that on execute.

05:26.100 --> 05:29.280
That class was doing something with the burst effects.

05:29.280 --> 05:31.530
It was executing these and take a look.

05:31.530 --> 05:34.980
Burst effects seems to have a couple arrays in here.

05:34.980 --> 05:37.110
It has a burst particles array.

05:37.110 --> 05:43.740
It has a burst sounds array and it even has camera shake, camera lens effect, burst force feedback

05:43.740 --> 05:47.220
burst device, property effect, burst decal.

05:47.220 --> 05:49.770
I mean, this is kind of insane.

05:50.070 --> 05:56.760
Now what happens if we add a burst of particles by just clicking the plus there and expanding the index?

05:56.760 --> 05:58.890
Well, whoa, look at this.

05:58.890 --> 06:02.280
This is a lot more than just a Niagara system.

06:02.280 --> 06:05.220
It's actually what looks to be a struct, right?

06:05.220 --> 06:09.240
It has some properties in it, including a Niagara system.

06:09.690 --> 06:17.520
So what I want to do is just learn a little bit about how this burst effects works before we go and

06:17.520 --> 06:20.340
tweak any parameters, any settings.

06:20.340 --> 06:23.190
Let's just set this Niagara system to something.

06:23.190 --> 06:25.380
We have NS arcane shards.

06:25.380 --> 06:31.620
We can set that and just see what happens when we execute this gameplay queue.

06:31.620 --> 06:34.380
Let's just go ahead and cast the spell.

06:35.120 --> 06:40.520
Okay, so we see something happening where spawning a whole bunch of shards.

06:40.520 --> 06:45.980
So we know that that's working, but it all spawned at the same location.

06:45.980 --> 06:48.200
So that's something to be aware of.

06:48.230 --> 06:51.350
Where is it spawning the location?

06:52.020 --> 06:55.560
Well, there are a couple of overrides in here with checkboxes.

06:55.560 --> 07:01.650
And if we expand these their spawn condition override and placement info override.

07:02.220 --> 07:07.170
But there's nowhere in here to set a location, so that seems to indicate that it's getting its spawn

07:07.170 --> 07:08.970
location from elsewhere, right?

07:09.420 --> 07:11.880
In fact, where did that spawn location start?

07:11.880 --> 07:12.660
Let's see.

07:13.020 --> 07:18.750
It started at our owning actor location, so it seems to default back to that.

07:19.110 --> 07:28.560
Okay, so what happens if we start this gameplay queue with a location passed in to its gameplay queue

07:28.560 --> 07:29.670
parameters?

07:29.670 --> 07:30.750
Let's just see.

07:30.750 --> 07:36.150
Let's take the world location where we're drawing our debug sphere and hook it in to the location here,

07:36.150 --> 07:38.280
and let's cast our spell.

07:39.970 --> 07:43.330
Oh look at that okay, okay.

07:43.330 --> 07:45.760
So that's a lot different, isn't it?

07:45.760 --> 07:50.860
It seems like whatever location we're passing in, we're getting some particles there.

07:50.860 --> 07:51.010
Now.

07:51.010 --> 07:55.270
They don't seem to coincide with those debug spheres do they.

07:55.600 --> 07:57.400
So there's a discrepancy there.

07:57.400 --> 08:01.000
And as soon as I stopped we see that we access none.

08:01.000 --> 08:04.900
Trying to read property call func get array item.

08:04.900 --> 08:07.180
So we're trying to get an array item here.

08:07.180 --> 08:10.990
And it's here in the gameplay ability Arcane shards.

08:10.990 --> 08:18.040
When we execute gameplay queue with params right here, we can click on this and it'll take us directly

08:18.040 --> 08:19.600
to the violation here.

08:19.600 --> 08:24.640
So we're attempting to get an array element out of bounds.

08:24.640 --> 08:31.360
So we're going to have to take this blueprint pure return value and promote this to a variable and call

08:31.360 --> 08:36.760
this shard spawn point or shard spawn location.

08:36.760 --> 08:42.970
And we're just going to have to write over this vector every time we execute this event.

08:42.970 --> 08:48.760
And then we don't have to rely on those blueprint pure values.

08:48.760 --> 08:56.170
We can just go ahead and use shard spawn location, our cached location variable, and I'm going to

08:56.170 --> 09:00.280
use that here as well in the gameplay queue parameters here.

09:01.740 --> 09:03.630
So let's see what happens now.

09:08.210 --> 09:09.860
Okay, so that's better.

09:09.860 --> 09:16.610
We seem to get one shard at each of our spheres, and that's looking pretty consistent.

09:16.610 --> 09:17.300
Right.

09:17.300 --> 09:19.490
And it's a little hard to see the spheres.

09:19.490 --> 09:26.030
We can draw them a little bit bigger just to prove to ourselves let's draw them at 50 and make them

09:26.030 --> 09:26.780
red.

09:27.430 --> 09:29.110
So they stand out a bit.

09:32.850 --> 09:37.650
And we can definitely see that those shards are spawning at those sphere locations.

09:37.650 --> 09:39.570
So that's looking good.

09:43.360 --> 09:44.200
Really nice.

09:44.200 --> 09:45.220
Really nice.

09:47.540 --> 09:50.420
Okay, so that tells us something.

09:50.420 --> 09:57.260
Our gameplay queue burst is a little bit more interesting than we might have initially thought.

09:57.260 --> 09:58.160
On burst.

09:58.160 --> 09:59.960
Yes, we can override it.

09:59.960 --> 10:03.440
We can do things in it like print strings, cool, cool strings.

10:03.440 --> 10:10.940
But we can also go to our class defaults and add burst effects, which is huge because if we add burst

10:10.940 --> 10:16.310
effects to this and it just takes care of things, well, we don't have to come in here and call spawn

10:16.310 --> 10:20.720
system at location and all that stuff.

10:20.720 --> 10:26.720
We can just add to burst effects and this takes care of it for us.

10:26.750 --> 10:35.000
Now it does have a rotation override, but it just lets us hard code XYZ values in it, so we can't

10:35.000 --> 10:42.320
really spawn these particles on a sloped surface by just adding them here, unfortunately.

10:42.320 --> 10:43.670
But that's okay.

10:43.670 --> 10:45.110
That's what on burst is for.

10:45.110 --> 10:50.660
We can just spawn system at location here if we want that sort of control.

10:50.900 --> 10:59.090
Okay, so now that we have burst particles we can collapse that dropdown and take a look at burst sounds.

10:59.090 --> 11:01.430
I'm going to click plus and expand it.

11:01.430 --> 11:09.200
And it appears to look kind of like burst particles looked where we had spawn condition override placement

11:09.200 --> 11:12.320
info override a Niagara system.

11:12.320 --> 11:14.480
Our Niagara system can even cast shadows.

11:14.480 --> 11:15.080
Look at that.

11:15.080 --> 11:18.800
But collapsing burst particles burst sounds is similar.

11:18.800 --> 11:20.540
We have spawn condition override.

11:20.540 --> 11:27.710
We have placement info override a sound, a looping fade out duration, a looping fade volume level,

11:27.710 --> 11:35.510
and then we can have sound parameter interface info if we want, but really we can just pass in a sound

11:35.510 --> 11:36.050
here.

11:36.870 --> 11:39.750
And if I search for shards, we have this arcane shards.

11:39.750 --> 11:42.480
We can browse to it and hear what it sounds like.

11:43.590 --> 11:46.530
It sounds kind of like rocks or shards.

11:46.560 --> 11:51.960
I'm going to just stick that in there and see what happens when I execute this.

11:51.960 --> 11:53.700
So let's listen closely.

11:58.600 --> 11:59.800
How about that?

11:59.830 --> 12:00.970
Pretty cool.

12:01.930 --> 12:07.780
Okay, so this shows us the magic of gameplay cue bursts and the limitations of it.

12:07.810 --> 12:15.610
Of course, we saw that when using burst particles, we could only override the rotation with a specific

12:15.610 --> 12:18.550
hard coded x, y, z set of values.

12:18.550 --> 12:24.220
But then again, we have on burst so we can do anything here, and we can take those parameters and

12:24.220 --> 12:25.660
we can use those too.

12:25.660 --> 12:28.180
So we have a bit more freedom.

12:28.660 --> 12:29.560
All right.

12:29.590 --> 12:35.740
Now before we wrap up, I'd like to just see what happens in multiplayer with this by setting the number

12:35.740 --> 12:36.850
of players to two.

12:36.880 --> 12:40.210
Pressing play and splitting the screen.

12:41.390 --> 12:44.300
And I'm first going to cast this spell on the server.

12:44.300 --> 12:45.620
Let's see what happens.

12:48.930 --> 12:50.910
Okay, so that looked pretty good.

12:50.940 --> 12:54.090
Let's cast the spell on the client this time.

12:59.460 --> 13:00.900
That's looking pretty good.

13:04.480 --> 13:07.600
And it looks like our random locations are pretty consistent.

13:07.600 --> 13:15.520
Let's go into GA Arcane shards, and let's set our num points from 11 down to four.

13:15.520 --> 13:16.900
And let's just take a look.

13:16.900 --> 13:20.230
It's easier to analyze a smaller number of shards.

13:21.210 --> 13:26.850
So on the client I'm going to cast, and I want you to pay attention to two things.

13:26.850 --> 13:31.020
One, look at the spheres that we're drawing, the debug spheres.

13:31.020 --> 13:36.450
And two, look at the actual particles that are Niagara systems are spawning.

13:36.450 --> 13:37.950
So two things to look at.

13:37.950 --> 13:39.900
Now I'm going to center this.

13:40.980 --> 13:42.300
Right here.

13:42.300 --> 13:48.840
And that's another thing we should notice, is that we're showing this, this magic circle locally,

13:48.840 --> 13:50.790
but we're also showing it on the server.

13:50.790 --> 13:56.490
That's something that our gameplay ability is predictively doing that we don't want it to do.

13:56.490 --> 13:59.520
We only want to show this on the local character.

13:59.520 --> 14:00.840
So that's something to fix.

14:00.840 --> 14:05.220
But centering this on the other character, let's take a look.

14:05.220 --> 14:07.500
First of all, look at the spheres.

14:09.330 --> 14:11.820
Notice the spheres are inconsistent.

14:11.820 --> 14:16.140
Okay, so the spheres don't appear to be predicted.

14:16.140 --> 14:17.820
But now I'm going to cast it again.

14:17.820 --> 14:21.180
And this time take a look at the shards.

14:21.980 --> 14:22.790
Ready.

14:25.270 --> 14:26.260
Interesting, right?

14:26.260 --> 14:28.480
The shards appear to be correct.

14:28.480 --> 14:31.090
And if you take a look at the server.

14:34.060 --> 14:38.080
We see that those shards appear at those sphere locations.

14:39.800 --> 14:41.750
But on the client, it's all out of whack.

14:41.750 --> 14:45.980
If I go over here on the client and I just actually just cast over here.

14:46.710 --> 14:51.030
Notice that there's a discrepancy between the spheres and the shards.

14:52.290 --> 14:56.100
They don't all spawn exactly at those sphere locations.

14:56.190 --> 15:00.270
But notice that the shards on the server do.

15:00.950 --> 15:02.900
We'll cast over here this time.

15:03.320 --> 15:07.280
Notice the spheres and the shards are consistent and they're in the same spot.

15:07.280 --> 15:08.720
So it's working on the server.

15:08.720 --> 15:13.880
But regardless, if we just look at the shards and compare them to each other.

15:15.330 --> 15:18.690
We'll see that they spawn at consistent locations.

15:18.690 --> 15:27.210
And if we suppress the debug sphere, because this could be distracting us a bit if we bypass that draw

15:27.210 --> 15:28.470
debug sphere.

15:34.450 --> 15:39.700
Now we should be able to analyze this a little easier if I cast this here.

15:40.940 --> 15:43.190
Notice that those shards.

15:44.100 --> 15:46.020
Are consistent with the server.

15:47.990 --> 15:54.470
So this tells us that simply drawing a debug sphere in a gameplay ability is not a predicted action,

15:54.470 --> 15:58.070
but executing a gameplay cue is.

15:58.070 --> 16:02.780
So executing that gameplay cue burst is taking care of this for us.

16:02.780 --> 16:08.990
And that's great, because on the server, we're going to be using those locations to do important things

16:08.990 --> 16:10.790
like cause damage, right?

16:10.880 --> 16:17.300
But on clients, we're just going to get that replicated gameplay cue burst.

16:17.300 --> 16:24.560
And that's going to be nice because when one of these shards knocks a goblin flying away, we'll get

16:24.560 --> 16:26.090
to see it and it'll look consistent.

16:26.090 --> 16:29.030
So now we know about a new type of gameplay cue.

16:29.030 --> 16:31.700
Notify the gameplay cue, notify burst.

16:31.700 --> 16:34.970
And it works pretty well as we've seen.

16:34.970 --> 16:37.220
I'm going to go ahead and bypass the print string.

16:37.220 --> 16:38.390
We don't need it anymore.

16:38.390 --> 16:43.580
We know that on burst is being executed so we can go ahead and save that.

16:44.850 --> 16:51.210
And now that we have this gameplay cue notify burst, we're one step closer to having a really cool

16:51.210 --> 16:52.500
looking ability.

16:53.010 --> 16:58.680
And we know that it's going to work and scale according to our ability level.

16:58.680 --> 17:04.290
If we take that num points and we set it back down to one, well then we're always going to get that

17:04.290 --> 17:07.170
shard spawned in the middle right there.

17:07.530 --> 17:11.010
So we'll start off with our spell looking like that.

17:11.010 --> 17:16.920
And then we're going to slowly level it up and then spawn more and more shards.

17:16.920 --> 17:18.480
And it's going to be awesome.

17:18.810 --> 17:21.360
For now, for testing, I'm going to set it back to 11.

17:21.360 --> 17:25.860
And with that excellent job and I'll see you in the next video.
