WEBVTT

00:06.780 --> 00:07.840
Welcome back.

00:07.860 --> 00:14.850
Now, in this video, we're going to very quickly see how hard it is to fight all these enemies with

00:14.850 --> 00:18.210
ora's measly little one fireball attack.

00:18.210 --> 00:26.520
But we're going to do our best to defeat them all, because I'd like to encounter a specific problem.

00:26.520 --> 00:30.750
I won't say bug, because it's really just something we haven't implemented yet.

00:30.750 --> 00:36.360
And that is what happens when we destroy or kill our enemies.

00:36.360 --> 00:40.110
What's happening from their behavior tree standpoint.

00:40.890 --> 00:47.670
So I'm going to press play and I'm going to do my best to just defeat all of my enemies before they

00:47.670 --> 00:53.250
defeat me, especially those ones that launch projectiles.

00:53.250 --> 00:53.520
Right?

00:53.520 --> 00:54.880
Those are the worst.

00:54.900 --> 01:01.140
I always try to get those projectile launchers before everything else because they just sit back and

01:01.140 --> 01:04.240
they try to hurt you and it's really annoying.

01:04.260 --> 01:04.530
All right.

01:04.560 --> 01:06.380
Now, here's what I'm talking about.

01:06.390 --> 01:07.110
Look at this.

01:07.110 --> 01:08.700
Those enemies are dead.

01:10.170 --> 01:13.300
And after they're dead, they're still firing.

01:13.320 --> 01:15.120
So why is that?

01:15.300 --> 01:17.640
Well, if we open our behavior tree.

01:17.670 --> 01:21.840
Notice we're never checking to see if the enemy is dead.

01:21.870 --> 01:27.660
The enemy doesn't even know from the behavior tree standpoint whether it's dead or not.

01:27.690 --> 01:32.850
We're going to need a blackboard key that we can set whenever our enemy dies.

01:32.880 --> 01:37.540
And that way the behavior tree will know if the enemy has died yet.

01:37.560 --> 01:39.420
So pretty simple fix.

01:39.420 --> 01:40.920
We're going to go to our blackboard.

01:40.920 --> 01:43.710
We're going to add a new key selecting BOOL.

01:43.830 --> 01:48.090
We're going to just call it dead and we're going to check this key.

01:48.120 --> 01:52.890
We're going to check it right here before doing anything else in this selector.

01:53.010 --> 01:56.610
So I'm going to right click and I can add it right here.

01:56.610 --> 02:00.660
And before I do, I notice that I really could name these nodes.

02:00.660 --> 02:06.090
This one is checking, hit, reacting, making sure hit reacting is not set.

02:06.090 --> 02:12.940
I'm going to change the node name to say am I not hit reacting?

02:14.680 --> 02:17.780
And this one is checking if Target to follow is set.

02:17.800 --> 02:19.330
I'm going to say.

02:20.940 --> 02:23.160
Do I have a target?

02:24.060 --> 02:25.650
And we'll add one more.

02:25.680 --> 02:29.490
It's going to be a decorator blackboard based.

02:29.490 --> 02:32.250
And I'm going to rename this one right away.

02:32.580 --> 02:36.180
Am I alive with a question mark?

02:36.420 --> 02:38.500
Now this one's going to check Dead.

02:38.520 --> 02:40.950
So Blackboard Key will be dead.

02:40.980 --> 02:45.010
And we don't want to continue unless dead is not set.

02:45.030 --> 02:47.100
In other words, dead should be false.

02:47.130 --> 02:51.540
Now, if this condition changes, I want to abort everything immediately.

02:51.540 --> 02:59.170
So I'm going to change notify observer to on value, change and observer aborts self and lower priority.

02:59.190 --> 03:01.300
In other words, I'm going to select both.

03:01.320 --> 03:06.630
So it's going to abort the entire tree if the enemy becomes dead.

03:06.660 --> 03:12.950
Now we just need to set this blackboard key and we can do that when the enemy dies from C plus plus.

03:12.960 --> 03:15.600
So I'm going to save all and close the editor.

03:15.660 --> 03:21.010
So I'm going to go into Ora Enemy and find its die function.

03:21.010 --> 03:22.000
Here it is.

03:22.000 --> 03:24.670
And we don't care about the multicast handle.

03:24.670 --> 03:27.910
Death function only die is what matters.

03:27.910 --> 03:29.290
That's what's called in the server.

03:29.290 --> 03:32.170
And for enemies, we're going to set that blackboard.

03:32.170 --> 03:33.100
Key value.

03:33.130 --> 03:34.570
How did we do this before?

03:34.570 --> 03:38.890
Well, if we go to possessed by, we can see how we're setting a value as BOOL.

03:38.890 --> 03:43.360
We're going to copy that line there and we'll go back to the die function.

03:43.360 --> 03:45.040
Paste that line here.

03:45.070 --> 03:51.760
We should have a valid AI controller, but we'll check just in case if or AI controller.

03:53.260 --> 03:58.090
And the value that we want to set is the blackboard key dead.

03:58.090 --> 04:00.970
And we want to set it to true if we've just died.

04:01.150 --> 04:07.930
So that should set that blackboard key and that should prevent us from doing anything in the blackboard.

04:08.230 --> 04:11.380
So we can go ahead and compile and launch the editor.

04:12.750 --> 04:14.400
And we can test this out.

04:14.400 --> 04:20.440
I'm going to go ahead and just kill some of these enemies, especially those ranged attackers.

04:20.460 --> 04:26.580
Let's see if we can kill them first before I get taken out.

04:26.820 --> 04:30.630
It's actually becoming a little bit more challenging, isn't it?

04:30.660 --> 04:34.740
Now that we have more enemies, it's a little harder.

04:35.880 --> 04:38.160
We're going to need some more powerful spells.

04:38.160 --> 04:39.930
I need some aoe spells.

04:39.930 --> 04:41.100
That would be nice.

04:41.100 --> 04:41.730
Okay.

04:42.310 --> 04:46.060
And I'm not getting fired at and that enemy has died.

04:46.060 --> 04:48.220
So it looks like we've done our job.

04:49.100 --> 04:50.000
Excellent.

04:50.270 --> 04:55.100
So as I was saying, it's becoming harder to fight these enemies without getting damaged.

04:55.100 --> 05:02.150
Now, that means we need a way for aura to get more powerful, gain more stats, gain more abilities,

05:02.150 --> 05:03.650
level up her abilities.

05:03.680 --> 05:07.850
It would be nice if our fireball could level up and get more powerful.

05:07.850 --> 05:11.960
It'd also be nice if we had some more area of effect skills.

05:11.960 --> 05:17.300
So we're going to need to do that and we will be doing that throughout the rest of the course.

05:17.390 --> 05:21.890
But more importantly, what happens when we kill an enemy, right?

05:21.920 --> 05:24.120
We should be gaining experience.

05:24.140 --> 05:28.310
We currently don't have a way to know what our experience is.

05:28.340 --> 05:31.250
We don't have a way to know what level we are.

05:31.280 --> 05:34.370
We need that sense of progress, right?

05:34.370 --> 05:41.090
We need to know that we're getting stronger, which means whenever we destroy or kill an enemy, we

05:41.090 --> 05:44.620
should see some kind of experience gauge go up.

05:44.630 --> 05:49.830
And once that experience gauge reaches a certain threshold, we should level up.

05:49.830 --> 05:52.830
And that means we should get more power.

05:52.830 --> 05:57.570
We should be able to open our attribute menu and spend attribute points.

05:57.570 --> 06:01.830
Remember, this top row is reserved for attribute points.

06:01.830 --> 06:04.800
That's something that we still haven't implemented yet.

06:04.830 --> 06:09.060
Our character has a level that's also something we haven't implemented.

06:09.060 --> 06:14.430
So these are the things that we need to make sure we have in our game.

06:14.430 --> 06:21.360
And once we're gaining experience and getting progress and gaining attribute points, then we can start

06:21.360 --> 06:24.320
thinking about expanding our spell repertoire.

06:24.330 --> 06:31.320
We can create a spell menu with a spell tree and gain spell points when we level up, and that will

06:31.320 --> 06:37.680
give us the opportunity to implement things like leveling up our abilities, creating newer, more powerful

06:37.680 --> 06:39.840
abilities and so on.

06:39.930 --> 06:46.500
And with those newer, more powerful abilities, we're going to discover different techniques that we

06:46.500 --> 06:51.930
can use with our gameplay abilities, including opportunities to create gameplay.

06:51.930 --> 06:59.640
Cuz the last missing piece of this gas puzzle and that is going to really give us the sense that we're

06:59.640 --> 07:08.820
playing an actual RPG game Once we have the ability to create that fun cycle where you're gaining progress,

07:08.820 --> 07:15.540
getting more powerful, killing more powerful enemies and the cycle continues for now.

07:15.540 --> 07:18.330
Great job and I'll see you in the next video.
