WEBVTT

00:06.930 --> 00:08.070
Welcome back.

00:08.070 --> 00:13.080
Now, before wrapping up this section, there are a few things I'd like to do.

00:13.560 --> 00:16.950
One is it's about time for some multiplayer testing.

00:16.950 --> 00:24.440
So we're going to do that and then we may upgrade a couple of cosmetics involving some of our gameplay

00:24.450 --> 00:25.980
so the things look better.

00:26.130 --> 00:33.210
But for now, let's just try testing this in multiplayer and seeing if we've introduced any bugs or

00:33.210 --> 00:35.760
anything that we should fix first.

00:35.760 --> 00:41.490
I'm going to set to play as listen server number of players should be two, I'm going to press play

00:41.490 --> 00:48.360
and on my client I'm going to launch a projectile and right away I see an exception.

00:48.360 --> 00:53.190
So let's flex our debugging muscles and see what we can find here.

00:53.460 --> 00:59.300
Now let's see where in shared pointer H and we have an access violation.

00:59.310 --> 01:05.910
Looks like we're trying to access a null pointer if we follow the call stack one level up, we're in

01:05.910 --> 01:09.670
gameplay effect h and get context.

01:09.760 --> 01:12.100
So we're returning effect context.

01:12.100 --> 01:16.570
Looks like the gameplay effect spec that we're in.

01:16.600 --> 01:19.150
That's this pointer is null.

01:19.270 --> 01:23.380
And then one level up on the call stack we're in on sphere Overlap.

01:23.380 --> 01:25.240
So let's see what we're doing here.

01:25.240 --> 01:26.920
That's not good.

01:26.920 --> 01:34.150
Now we're in this second if statement and we saw that the effect spec was null and that's not good because

01:34.150 --> 01:39.250
this effect spec handle data dot get is accessing that pointer.

01:39.250 --> 01:43.960
So I seem to recall thinking that we checked that up here.

01:43.960 --> 01:44.560
Right?

01:44.560 --> 01:47.950
If we check that here, why are we still getting down here?

01:47.950 --> 01:50.290
Well, that must mean we made a mistake up here.

01:50.290 --> 01:56.020
And now that the debugger has brought my attention to it, I'm definitely seeing my mistake.

01:56.020 --> 01:58.270
I made a logic error here.

01:58.300 --> 02:03.580
You see, I'm checking damage effect spec handle data dot is valid.

02:03.580 --> 02:05.830
If it's valid, this will be true.

02:05.860 --> 02:07.000
We don't want to return.

02:07.000 --> 02:08.500
If it's true, we want to return.

02:08.500 --> 02:11.380
If it's false, we want to return if it's not valid.

02:11.380 --> 02:17.530
So if we replace that with not is valid, well, that's a start.

02:17.530 --> 02:20.170
But we have an end here, right?

02:20.200 --> 02:25.930
We're checking to see if the spec handles effect causer is equal to the other actor.

02:25.930 --> 02:31.780
Now, an end means both of these have to be true to enter this if statement.

02:31.780 --> 02:35.350
But really either one of them should make us return early.

02:35.350 --> 02:38.170
If the spec handle is not valid, we should return.

02:38.170 --> 02:40.540
And if this condition is true, we should return.

02:40.540 --> 02:45.610
So really this should be an Or so that was my logic mistake.

02:45.610 --> 02:47.350
But we found it.

02:47.350 --> 02:52.660
And it's quite possible that as you were following along, you might have seen these types of little

02:52.660 --> 02:53.080
logic.

02:53.080 --> 03:01.960
Mistakes are easy to sneak in, and the way to prevent them or clean them out is by testing and being

03:01.960 --> 03:02.770
careful.

03:02.890 --> 03:04.840
So I'm going to go ahead and hit stop.

03:04.840 --> 03:13.540
And with this fix in place, I expect to be able to launch a fireball on a client without hitting that

03:13.540 --> 03:14.530
exception.

03:14.530 --> 03:16.510
So let's try that again.

03:17.740 --> 03:19.120
So here we go.

03:19.120 --> 03:21.080
We have a number of players set to two.

03:21.130 --> 03:27.850
We're playing as listen server and I'm going to grab my client and launch a fireball and things are

03:27.850 --> 03:28.720
fixed.

03:28.750 --> 03:30.430
Let's see if we can take damage.

03:30.430 --> 03:34.210
Let's see if we can defeat some enemies, maybe kill a couple.

03:34.240 --> 03:36.580
Looks like my client is dead already.

03:36.610 --> 03:43.780
This is actually getting quite difficult with this many enemies, and that's actually kind of fun.

03:43.780 --> 03:44.710
I like it.

03:45.250 --> 03:51.310
Another thing I'm noticing is my shaman does not dissolve like my other enemies do.

03:51.340 --> 03:57.910
I kind of like how the ghoul just sort of turns into a giant bird and it spreads its wingspan there.

03:57.910 --> 04:02.290
That's kind of cool, but our shaman does not dissolve, so that's another thing.

04:02.290 --> 04:08.350
It's not really a multiplayer test issue, but it's more just something I just realized while testing

04:08.350 --> 04:10.150
and we can take care of that too.

04:10.240 --> 04:12.550
So why don't we do that?

04:12.550 --> 04:14.950
I'm just going to edit BP Shaman.

04:14.950 --> 04:18.770
I'm going to select the mesh and browse to it.

04:18.770 --> 04:21.380
And here I have a materials folder.

04:21.380 --> 04:23.270
Here's my shaman.

04:23.270 --> 04:29.990
Pretty simple material, but I'm going to turn it into a material that can be dissolved, which means

04:29.990 --> 04:37.700
I need to go to assets, materials M dissolve effect and copy this big piece right here.

04:37.730 --> 04:38.270
Ctrl.

04:38.270 --> 04:41.750
C Come back to Shaman, Ctrl V.

04:41.840 --> 04:48.860
Now remember, this comment tells us some properties that our material has to have, so we need to select

04:48.890 --> 04:53.840
M Shaman over there and make sure that material domain is surface.

04:54.460 --> 04:55.950
Blend mode is masked.

04:55.960 --> 04:57.820
That's the only one we have to change.

04:57.820 --> 05:00.160
And shading model is default lit.

05:00.160 --> 05:03.250
And then this one goes to emissive color.

05:03.250 --> 05:05.830
So we'll bring it down and stick it in.

05:05.830 --> 05:08.830
And then this other one goes to Opacity mask.

05:08.830 --> 05:15.310
We'll bring it in, stick it in and notice that our material is partially dissolved.

05:15.310 --> 05:21.340
We saw that giving this dissolve parameter a negative two by default fixes that.

05:21.340 --> 05:26.080
And then we need a material instance based on Im shaman.

05:27.490 --> 05:35.530
So we can browse back to Shaman, right click on it, create a material instance, call this my underscore

05:35.680 --> 05:39.280
shaman, underscore, dissolve.

05:39.370 --> 05:47.770
And now we have a dissolve material and we can set that in Bpy Shaman by selecting Bpy Shaman self searching

05:47.770 --> 05:48.880
for Dissolve.

05:48.880 --> 05:50.890
And we have that material instance.

05:50.890 --> 05:53.440
We're going to set that to me.

05:53.620 --> 05:55.330
Shaman Dissolve.

05:55.360 --> 06:00.070
Now the shaman has a weapon too, which means we need to do this for the weapon.

06:00.070 --> 06:01.660
So let's do it.

06:01.660 --> 06:03.100
I'm going to select the weapon.

06:03.100 --> 06:07.120
I'm going to browse to it, go to its materials and open its material.

06:07.150 --> 06:08.470
Im staff.

06:08.500 --> 06:15.100
Let's see if I still have that collection of nodes copied to my clipboard Ctrl V and yes I do.

06:15.130 --> 06:16.360
That's awesome.

06:16.360 --> 06:19.420
So let's change the material properties.

06:19.420 --> 06:22.960
Really, we just need to change the blend mode to Masked and we're good.

06:22.960 --> 06:30.650
And then we can take this to emissive color and stick it into emissive color there like so.

06:30.650 --> 06:33.470
And we can take this one to opacity mask.

06:33.470 --> 06:40.250
We can stick that in opacity mask and we can take our dissolve and set it to negative two.

06:40.280 --> 06:48.560
Now we have a staff and we can right click on it, create a material instance called me, I'm going

06:48.560 --> 06:51.800
to call it Shaman Staff.

06:52.780 --> 06:54.280
Underscore dissolve.

06:55.060 --> 06:58.510
And now that we have that, we can go back to BP Shaman.

07:00.190 --> 07:07.900
Search for dissolve and hit that left arrow to set this to that material instance.

07:08.320 --> 07:12.790
Now, if we go in and kill the shaman, we should see it dissolve.

07:12.790 --> 07:15.070
Let's just make sure that that works.

07:17.030 --> 07:21.500
And it does not.

07:21.680 --> 07:23.900
So let's find out why.

07:25.570 --> 07:33.250
I'm going to go to Content Blueprints, Character and Open Enemy base where we have our Start dissolve

07:33.280 --> 07:39.700
timeline and we have these scalar parameter value dissolve.

07:39.700 --> 07:42.270
I believe we ran into this with the Google, didn't we?

07:42.280 --> 07:49.390
Let's go back to our M Shaman material and browse to it so we can open my shaman.

07:49.390 --> 07:51.670
And I don't see those parameters there.

07:51.670 --> 07:59.230
So we're going to go back to M Shaman and apply and then back to my shaman dissolve.

07:59.230 --> 08:01.000
And now I see those parameters.

08:01.000 --> 08:03.250
We need to do that for M staff as well.

08:03.250 --> 08:09.850
We need to hit apply and if we browse to that and check it out, here's the Shaman staff.

08:09.850 --> 08:11.560
Now I see the parameters.

08:11.560 --> 08:15.700
With that, we should be able to test this out.

08:16.060 --> 08:19.420
I'm going to save all first and then.

08:20.100 --> 08:26.040
We can try to kill the shaman and it dissolves and it looks awesome.

08:26.280 --> 08:27.540
Excellent.

08:27.990 --> 08:28.570
Awesome.

08:28.590 --> 08:29.180
Awesome.

08:29.190 --> 08:30.330
All right.

08:30.330 --> 08:32.560
So that takes care of that issue.

08:32.580 --> 08:34.140
So things are looking pretty good.

08:34.140 --> 08:40.650
I think we can just add a few more cool cosmetic touches to our current gameplay mechanics.

08:40.650 --> 08:46.210
But after that we're ready to move on to XP and leveling up.

08:46.230 --> 08:47.150
Great job.

08:47.160 --> 08:48.210
I'll see you soon.
