All language subtitles for 13. FSM Attack (GOOD)

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian Download
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,030 --> 00:00:01,800 Welcome to the attack functionality. 2 00:00:01,830 --> 00:00:05,770 Every tank type in this project has a different attack structure. 3 00:00:05,790 --> 00:00:10,760 We will need to go through each state machine and also through the code that powers everything. 4 00:00:10,770 --> 00:00:16,410 But before, we need to discuss the bigger picture of the attack, because when an agent receives a 5 00:00:16,410 --> 00:00:18,750 new target, the attack state is triggered. 6 00:00:18,840 --> 00:00:20,580 This happens for all the attacks. 7 00:00:20,640 --> 00:00:26,550 Most likely the target is not in the firing range, so the tank needs to adjust its position to get 8 00:00:26,550 --> 00:00:27,150 close to it. 9 00:00:27,180 --> 00:00:31,950 Once it is closer, it will fire and then it will do a reload, also known as a cooldown. 10 00:00:31,980 --> 00:00:35,210 There are some variations to this as following the aggressive. 11 00:00:35,280 --> 00:00:39,510 I will follow this pattern, move the target attack and then reload. 12 00:00:39,540 --> 00:00:44,860 After the reload it will try to move to target if necessary, then attack and reload the defensive. 13 00:00:44,940 --> 00:00:46,530 I will follow this pattern. 14 00:00:46,530 --> 00:00:48,870 Move to target, attack burst cooldown. 15 00:00:48,870 --> 00:00:55,230 So this means that a series of repeated attacks, then reload, then go to cover and then finally repeat 16 00:00:55,260 --> 00:01:00,570 the tactically I is going to first move to cover position, then attack, then do a cooldown and also 17 00:01:00,570 --> 00:01:01,920 adjust if necessary. 18 00:01:01,920 --> 00:01:03,800 And lastly, move to cover position again. 19 00:01:03,810 --> 00:01:06,930 So basically everything has a cycle, but it's a little different. 20 00:01:06,930 --> 00:01:10,170 So we'll go into each state machine and see how it works. 21 00:01:10,200 --> 00:01:16,590 Let's start by looking at the script that powers everything after the main initialization of various 22 00:01:16,590 --> 00:01:22,860 objects and systems that are required for this, we need to look at some other objects that are really 23 00:01:22,860 --> 00:01:28,110 important here, and some of these are, of course, the timers because we already know the tank mover 24 00:01:28,110 --> 00:01:33,000 is the system that is responsible for moving the tank and that sends a signal I'm finished moving, 25 00:01:33,000 --> 00:01:37,890 but we have a couple of different timers like Reload, Burst Cooldown, go to Target. 26 00:01:37,890 --> 00:01:41,180 So let's quickly go through each one of them and see what they do. 27 00:01:41,190 --> 00:01:45,300 The reload timer is triggered after each shot to put the delay between them. 28 00:01:45,300 --> 00:01:51,540 The burst timer is used for the defensive air to fire a sequence of projectiles and then do the reload. 29 00:01:51,540 --> 00:01:57,150 The go to target timer is triggered when the location was reached and the air needs to wait a little, 30 00:01:57,150 --> 00:01:59,760 let's say idle time to make it look more realistic. 31 00:01:59,820 --> 00:02:06,300 The timer target search for how long the eye will actually search for a lost target and the cover weight 32 00:02:06,300 --> 00:02:09,960 will know for how long the eye needs to stay behind a cover. 33 00:02:09,960 --> 00:02:14,730 We also will adjust some default parameters for the final state machine in entry. 34 00:02:14,730 --> 00:02:17,820 That happens only once the state enters. 35 00:02:17,850 --> 00:02:19,560 We have the following things. 36 00:02:19,560 --> 00:02:25,800 If it's the entry state, then this means that the state for the attack was the initial one, basically 37 00:02:25,800 --> 00:02:28,530 the entry state here and only fits the entry state. 38 00:02:28,530 --> 00:02:32,700 We restart the communicator and if it's any other state we'll do the following. 39 00:02:32,730 --> 00:02:38,220 If the tank is in the go to state, we first need to make sure that the target is still valid because 40 00:02:38,220 --> 00:02:42,180 we cannot go to a target that's destroyed by another enemy. 41 00:02:42,180 --> 00:02:46,770 We will generate a new path towards it by using the nav mesh and get a simple path. 42 00:02:46,770 --> 00:02:51,690 So we'll stop the tank mover in its current path and we will send the new path. 43 00:02:51,690 --> 00:02:57,630 The move path the state will exit was the range between the agent and the player gets lower than the 44 00:02:57,630 --> 00:02:59,220 firing range of the current. 45 00:02:59,640 --> 00:03:01,740 This range is updated at every frame. 46 00:03:01,740 --> 00:03:03,690 We will look at that into a second. 47 00:03:03,720 --> 00:03:09,240 Once we are entering the firing state or the attack fire, we need to check the target to see if it's 48 00:03:09,240 --> 00:03:09,810 still valid. 49 00:03:09,810 --> 00:03:14,880 We will stop the tank mover because the next step is to fire a projectile. 50 00:03:14,880 --> 00:03:16,890 So we will issue a fire command. 51 00:03:16,950 --> 00:03:20,520 If the state is go to wait, we will start the weight timer. 52 00:03:20,520 --> 00:03:24,840 We will, of course, stop the tank movement and then start the go to timer. 53 00:03:24,840 --> 00:03:30,780 We have a random range to make the tank look like it's holding its breath for a second before continuing 54 00:03:30,780 --> 00:03:31,800 to a different position. 55 00:03:31,830 --> 00:03:37,050 The next state is called Search for Target State, and here the first thing to do we need to set the 56 00:03:37,260 --> 00:03:41,370 target search over to false, then start the target search timer. 57 00:03:41,490 --> 00:03:46,020 This timer, once it reaches zero, it means that we didn't find the target in the timer. 58 00:03:46,020 --> 00:03:49,620 So it will completely remove the target from this guy's memory. 59 00:03:49,620 --> 00:03:57,210 And lastly, we need to stop the tank mover and we will need to generate a path from the current position 60 00:03:57,450 --> 00:03:59,730 to the last known position of the target. 61 00:03:59,820 --> 00:04:02,730 And we will give this path back to the tank mover. 62 00:04:02,730 --> 00:04:07,950 Of course, we need to set up the parameters for the finite state machine that is target search over 63 00:04:07,950 --> 00:04:10,320 to false because we are just starting it. 64 00:04:10,380 --> 00:04:15,180 The hide state is specific to the defensive way and is called. 65 00:04:15,180 --> 00:04:21,630 After each reload happens the tank will do a sequence of fire, then move to cover, then fire again. 66 00:04:21,630 --> 00:04:24,240 For this we need to stop the tank mover. 67 00:04:24,270 --> 00:04:26,250 We need to get the new cover point. 68 00:04:26,430 --> 00:04:31,520 And of course, if the cover point is not normal, so this means that it exists, we need to generate 69 00:04:31,530 --> 00:04:33,480 a new move path using the nav mesh. 70 00:04:33,510 --> 00:04:34,920 Give this to the tank mover. 71 00:04:34,950 --> 00:04:38,040 We also need to disable the lose target from the target handler. 72 00:04:38,040 --> 00:04:43,800 This will make sure that once the defensive breaks visual contact with the target, we don't actually 73 00:04:43,800 --> 00:04:48,570 start the lose target timer because otherwise it will go into hiding and then it lose the target by 74 00:04:48,570 --> 00:04:49,620 the time it comes back. 75 00:04:49,620 --> 00:04:53,790 And we need to initialize the current cover to the last detected cover. 76 00:04:53,790 --> 00:04:56,220 We will also set up the cover miscount to zero. 77 00:04:56,340 --> 00:04:59,790 The attacker just position state is only used for the. 78 00:04:59,900 --> 00:05:00,440 Tactical. 79 00:05:00,470 --> 00:05:01,120 Thank you, I. 80 00:05:01,340 --> 00:05:08,240 This state what it does is basically detects when the tactical tank guy doesn't hit the player over 81 00:05:08,240 --> 00:05:13,910 and over again, which means that probably it's quite close to the building and we need to adjust the 82 00:05:13,910 --> 00:05:14,480 position. 83 00:05:14,630 --> 00:05:18,680 So first, of course, we need to check if the target is not now, then we need to stop. 84 00:05:18,680 --> 00:05:23,360 Any movement will calculate the direction vector from the current agent to the player. 85 00:05:23,360 --> 00:05:30,040 And basically we need to move in the opposite side to get a clearance between the agent and the building. 86 00:05:30,050 --> 00:05:34,730 I just put minus ten here so we will get to the current tank position. 87 00:05:34,730 --> 00:05:40,220 We add the new direction that you just calculated between it and the player, and we multiply this station 88 00:05:40,220 --> 00:05:45,410 to minus ten, so we get a proper clearance hopefully, and then we'll move to this new position in 89 00:05:45,410 --> 00:05:49,970 hopes that the adjusted position will be better from the current one in on update. 90 00:05:50,030 --> 00:05:53,480 Things happen every single frame when this state runs. 91 00:05:53,480 --> 00:05:57,710 If there is a target and it's valid, we need to look at it all the time. 92 00:05:57,710 --> 00:05:58,580 We've our target. 93 00:05:58,580 --> 00:06:03,920 Of course, you need to set other two rotations of the turret to zero so that the turret doesn't tilt 94 00:06:03,920 --> 00:06:04,820 in the wrong ways. 95 00:06:04,820 --> 00:06:11,060 And then we will also need to check the distance between the current agent and the target to see if 96 00:06:11,060 --> 00:06:12,950 it's less than the attack range. 97 00:06:12,950 --> 00:06:17,720 And if it is, then it is in the minimum range and this will be used for firing purposes. 98 00:06:17,720 --> 00:06:18,440 On update. 99 00:06:18,440 --> 00:06:25,160 Also the tank direct position animation happens and basically what this means is we set up the position 100 00:06:25,160 --> 00:06:30,590 based on the tank third position, which is a position three D on the tank body and we need to move 101 00:06:30,590 --> 00:06:37,190 on the forward axis using the turret and even forward, which is basically a float value from 0 to 1 102 00:06:37,190 --> 00:06:40,910 that is animated real time when a projectile gets shot. 103 00:06:41,030 --> 00:06:46,580 And also on update, if we are currently searching for the target and the tank mover has finished its 104 00:06:46,580 --> 00:06:47,900 path, we don't need to wait. 105 00:06:47,900 --> 00:06:51,230 We need to move the tank around to see if we can find the target. 106 00:06:51,230 --> 00:06:57,260 So for this, we will generate two values that we can add to the current tank position so that the tank 107 00:06:57,260 --> 00:07:00,950 can move to nearby locations and see if it finds the target. 108 00:07:00,950 --> 00:07:05,060 Of course, if no target is found, then eventually the target is permanently lost. 109 00:07:05,090 --> 00:07:11,090 Now we are entering the fire function and in here we of course need to instantiate the projectile. 110 00:07:11,090 --> 00:07:12,770 We will also play the animation. 111 00:07:12,770 --> 00:07:15,770 So first we reset the animation and then we play the turret fire. 112 00:07:15,800 --> 00:07:18,170 And there are two types of attacks. 113 00:07:18,260 --> 00:07:23,120 The regular one is just firing projectile and then entering the cooldown or reload. 114 00:07:23,120 --> 00:07:26,810 And the second one, we will fire multiple projectiles in a burst. 115 00:07:26,810 --> 00:07:31,940 And then after the maximum burst projectiles was reached, then we enter reload. 116 00:07:31,970 --> 00:07:33,590 If not, we start the burst. 117 00:07:34,040 --> 00:07:38,360 The burst is basically just the smaller reload, so it looks the same. 118 00:07:38,360 --> 00:07:41,150 But instead of having a longer wait times. 119 00:07:41,150 --> 00:07:47,030 So we fire a series of four projectiles one by one, and then have a longer time to reload all of them. 120 00:07:47,030 --> 00:07:53,030 And then we fire more the busted just for the defensive tank, because the third there has more locations 121 00:07:53,030 --> 00:07:53,750 that get far. 122 00:07:53,750 --> 00:07:58,340 Projectiles from the reload and the burst functionalities are very straightforward. 123 00:07:58,340 --> 00:08:03,500 So first we need to set is reloading to true and in the case of burst this burst cooling down through 124 00:08:03,530 --> 00:08:10,610 then we start either the reload timer or the burst timer cooldowns and both of them actually are randomized 125 00:08:10,610 --> 00:08:11,840 between different ranges. 126 00:08:11,840 --> 00:08:16,610 This will give slightly different variations of the cooldowns to make it look more realistic. 127 00:08:16,820 --> 00:08:22,010 And lastly, we set the final state machine to is reloading or is burst cooling down. 128 00:08:22,100 --> 00:08:27,260 This will make sure that the final state machine is in the correct state in the instantiate projectile, 129 00:08:27,260 --> 00:08:29,030 which is called here in the fire. 130 00:08:29,030 --> 00:08:33,920 We need to create the new projectile and we will use the new instance of the projectile prefab which 131 00:08:33,920 --> 00:08:35,300 is seen in Godot. 132 00:08:35,300 --> 00:08:38,840 And we will add this to the root of the scene. 133 00:08:39,170 --> 00:08:45,260 The next step is, of course, to get the fire point and the tank can have one or more fire points depending 134 00:08:45,260 --> 00:08:46,520 on its structure. 135 00:08:46,610 --> 00:08:49,550 This code will cycle through multiple target points. 136 00:08:49,550 --> 00:08:50,780 In the case it's only one. 137 00:08:50,780 --> 00:08:55,310 Then it will just give the same one over and over again, if not to give the next one and then the next 138 00:08:55,310 --> 00:08:55,490 one. 139 00:08:55,490 --> 00:08:57,650 And then it'll go back again to the zero. 140 00:08:57,740 --> 00:09:04,290 We also initialize the visual effects, the smoke and the muzzle for each projectile shot. 141 00:09:04,290 --> 00:09:07,160 And lastly, we will initialize the projectile. 142 00:09:07,160 --> 00:09:12,200 And this is the interesting part because we have three projectiles and each behaves completely different 143 00:09:12,200 --> 00:09:13,130 from the previous one. 144 00:09:13,130 --> 00:09:16,670 And some might need some parameters, others might need different ones. 145 00:09:16,760 --> 00:09:22,760 I opted to include all the parameters for every single projectile, and this is because by doing this, 146 00:09:22,760 --> 00:09:28,100 even though some projectiles once initialized will receive parameters that they don't use, we can use 147 00:09:28,100 --> 00:09:33,260 one initialized line and then we can shop the projectiles here to whatever we need. 148 00:09:33,260 --> 00:09:37,160 And we don't need to have three different initialize sequences like this. 149 00:09:37,490 --> 00:09:43,970 One, two, three, of course, with ifs between and check the projectile type because all of them share 150 00:09:43,970 --> 00:09:45,080 the same header. 151 00:09:45,230 --> 00:09:48,320 So this is quite cool and this is very maintainable for a project. 152 00:09:48,320 --> 00:09:54,440 And this part of the script handles a lot of callbacks from various systems and timers. 153 00:09:54,440 --> 00:09:59,540 So for example, unfinished moving is actually called by the tank mover and it will start the. 154 00:09:59,620 --> 00:10:00,630 Overweight timer. 155 00:10:00,640 --> 00:10:06,490 If that's the case and if it's the tactical enemy type, then we'll set the should adjust position to 156 00:10:06,490 --> 00:10:07,000 false. 157 00:10:07,030 --> 00:10:12,730 On projectile miss is actually called by the projectile and this is most used for the tactical thank 158 00:10:12,730 --> 00:10:18,640 you to adjust its position and this one needs to know if the current hit object was actually the terrain 159 00:10:18,640 --> 00:10:19,630 and not the building. 160 00:10:19,630 --> 00:10:23,710 Because if it's the terrain, then we won't continue because it's not actually a miss. 161 00:10:23,710 --> 00:10:30,700 We only go through here if the object was a building or another object that was between the enemy and 162 00:10:30,700 --> 00:10:36,970 the tank, we will start increasing the miscount because if we reach the maximum miscount, then we 163 00:10:36,970 --> 00:10:40,150 will set the final state machine to adjust the position. 164 00:10:40,180 --> 00:10:42,400 We will also use the cover miscount. 165 00:10:42,400 --> 00:10:48,160 So this next step is that we, even if we try to adjust the position locally in the same cover for, 166 00:10:48,160 --> 00:10:54,850 let's say three times, if the cover is still bad, then we need to change the cover entirely so we 167 00:10:54,940 --> 00:10:56,470 count, discover, miscount. 168 00:10:56,800 --> 00:11:02,260 And if this one gets reached, then of course we set it to zero because we need to make sure that it 169 00:11:02,260 --> 00:11:03,310 works again and again. 170 00:11:03,550 --> 00:11:09,190 But we will stop the should adjust position and we will call is cover bed and this will actually trigger 171 00:11:09,190 --> 00:11:14,020 a change of cover to hopefully a better one that can actually reach the player on finished. 172 00:11:14,020 --> 00:11:19,090 Reloading is actually going to set the easy loading to false and then depending of the enemy type, 173 00:11:19,450 --> 00:11:25,030 it will either do the reloading for the aggressive and the tactical air, but for the defensive it will 174 00:11:25,030 --> 00:11:32,290 trigger the attack hide because after each single reload the defensive I will go into hiding unburnt 175 00:11:32,290 --> 00:11:33,250 cooldown finished. 176 00:11:33,250 --> 00:11:39,130 We need to set the burst cooldown parameter to false and then we need to inform the final state machine 177 00:11:39,130 --> 00:11:42,780 by setting the parameter as well as to the correct one on go to target. 178 00:11:42,800 --> 00:11:49,090 Finished is basically called by the timer when we already have some wait time and the current new target 179 00:11:49,090 --> 00:11:55,540 and we need to stop that wait time on its target search over is called when the timer for the target 180 00:11:55,540 --> 00:11:57,280 search has time out to zero. 181 00:11:57,280 --> 00:12:03,640 And lastly on the cover timeout is called when the cover timer gets zero and we need to call the trigger 182 00:12:03,640 --> 00:12:05,110 for the final state machine. 183 00:12:05,140 --> 00:12:09,280 Also, we need to set the target handler to enable lose target again. 184 00:12:09,490 --> 00:12:14,110 No, let's check each individual state machine based on the tank and they'll start with the aggressive 185 00:12:14,110 --> 00:12:14,920 one in here. 186 00:12:14,920 --> 00:12:17,710 It might look like it's a mess, but it's actually a calculated miss. 187 00:12:17,710 --> 00:12:23,890 One entry happens when we actually acquire the target and on this branch should retreat is false because 188 00:12:23,890 --> 00:12:26,110 we don't want the enemy to retreat. 189 00:12:26,170 --> 00:12:31,570 The go to functionality will generate a path towards the target and we'll try to move the rider. 190 00:12:31,570 --> 00:12:37,390 And if the target is in range, then we will trigger the attack fire and after the attack fire if everything 191 00:12:37,390 --> 00:12:37,780 is fine. 192 00:12:37,780 --> 00:12:42,880 So this means that it still has the target, it shouldn't retreat, then it will go to attack cooldown. 193 00:12:43,030 --> 00:12:46,210 Of course the parameters here need to be that it is reloading. 194 00:12:46,210 --> 00:12:51,610 The target is still in range and it's not retreating and once the cooldown finishes it will set. 195 00:12:51,610 --> 00:12:55,810 The parameter is rolling to false and it will enter the fire state again. 196 00:12:55,810 --> 00:13:02,590 And basically, if it is in range, these two states will bounce back and forth until the enemy kills 197 00:13:02,590 --> 00:13:03,070 the player. 198 00:13:03,070 --> 00:13:09,220 In the case that the target is not in the firing range anymore and this is false, it'll go to wait 199 00:13:09,220 --> 00:13:14,410 and it will wait some time and then it will trigger go to the target at some point. 200 00:13:14,590 --> 00:13:19,330 This or this might actually go to the target, but might lose the target. 201 00:13:19,330 --> 00:13:22,000 And in this case, the target will be false. 202 00:13:22,240 --> 00:13:25,330 And in this state attack, such target will enter. 203 00:13:25,420 --> 00:13:31,150 And here the I will go to the last known position of the target and then it will randomly search around 204 00:13:31,150 --> 00:13:32,950 to see if a target was found. 205 00:13:33,040 --> 00:13:37,810 If the target is found, then this will be true and it will go back to go to if it's needed. 206 00:13:37,810 --> 00:13:40,780 And if the target is a range, it will go directly to the fire. 207 00:13:40,780 --> 00:13:46,300 And if such target state finishes with no target in sight, then the search is over and we exit this 208 00:13:46,300 --> 00:13:48,670 state probably heading over to patrol state. 209 00:13:48,970 --> 00:13:52,830 And this is the final state machine for the aggressive AI. 210 00:13:52,900 --> 00:13:55,060 Now let's look at the defensive one. 211 00:13:55,300 --> 00:14:01,570 So the defensive valley has a similar state machine because it still enters, it still goes to the target. 212 00:14:01,630 --> 00:14:04,120 If the target in range, it starts to fire. 213 00:14:04,240 --> 00:14:08,740 But the fire sequence first will bounce between fire and the burst cooldown. 214 00:14:08,740 --> 00:14:14,260 This will happen for as many projectiles we can launch per session, and once the session is over, 215 00:14:14,260 --> 00:14:15,700 we will go into the cooldown. 216 00:14:16,030 --> 00:14:17,200 The cooldown is finished. 217 00:14:17,230 --> 00:14:20,290 Instead of going directly back to fire, we will go into hiding. 218 00:14:20,290 --> 00:14:25,300 So this means it will pick a cover point and to try to go there once a certain time passes, we will 219 00:14:25,300 --> 00:14:27,550 end the hiding and go to the target again. 220 00:14:27,550 --> 00:14:32,200 And once the target is orange, go to fire, then the burst cooldown, then fire again. 221 00:14:32,200 --> 00:14:39,130 Cooldown I go to and it will go to this loop until eventually the target that might be lost or might 222 00:14:39,130 --> 00:14:40,810 be in search target mode. 223 00:14:40,900 --> 00:14:42,610 So this is the defensive enemy. 224 00:14:42,850 --> 00:14:48,610 And lastly, we have the tactical enemy and this one has the most different state machine because once 225 00:14:48,610 --> 00:14:51,670 it enters, it will actually go into hiding and hiding. 226 00:14:51,670 --> 00:14:56,680 In this case, it will pick a cover point that is relatively far away from the player. 227 00:14:56,680 --> 00:14:59,050 And after it's safe, then it will trigger. 228 00:14:59,200 --> 00:15:02,410 The fire in firing mode, of course, will go to cooldown. 229 00:15:02,470 --> 00:15:08,410 And once the cooldown is finished, the fire mode can also detect that the projectiles haven't hit the 230 00:15:08,410 --> 00:15:09,280 player for a while. 231 00:15:09,310 --> 00:15:14,140 So this means that we might have a building that might actually interfere between our shots. 232 00:15:14,140 --> 00:15:16,690 And in this case, the adjust position is called. 233 00:15:16,720 --> 00:15:21,220 The adjust position basically creates for the vector between the enemy and the player and then moves 234 00:15:21,220 --> 00:15:26,380 in the opposite direction so that it'll give the enemy a bigger clearance from the building. 235 00:15:26,410 --> 00:15:31,510 If after a couple of adjustments of the position, the fire still hits the building, then it will try 236 00:15:31,510 --> 00:15:32,440 to change the cover. 237 00:15:32,440 --> 00:15:36,390 So it will go through this cover battle and then it'll stop location. 238 00:15:36,400 --> 00:15:39,640 This means that the cover will be swapped for hopefully a better one. 239 00:15:39,640 --> 00:15:40,930 And here it doesn't happen. 240 00:15:40,930 --> 00:15:45,970 Anything just is just a small transition state because the cover still gives the same functionality 241 00:15:45,970 --> 00:15:50,980 from attack height and then it'll go back to fire and go to cooldown and then check if the position 242 00:15:50,980 --> 00:15:53,650 is to be adjusted or not and do this back and forth. 243 00:15:53,650 --> 00:15:59,260 Once the target is lost, we will enter the search target state, which is similar to the other two 244 00:15:59,260 --> 00:16:00,100 enemy types. 245 00:16:00,100 --> 00:16:05,110 And if the target was found, of course we need to go back to cover and then start the fire sequence. 246 00:16:05,110 --> 00:16:10,390 But if the target was not found, then we will head over to exit and probably go to the patrol state. 247 00:16:10,420 --> 00:16:15,160 We shouldn't worry about the tactical UI because this one has a huge range, so most likely it will 248 00:16:15,160 --> 00:16:16,690 get the target back again. 249 00:16:16,810 --> 00:16:22,690 Also, one difference from the other two eyes is that this doesn't require the direct line of sight. 250 00:16:22,690 --> 00:16:26,530 It would be much more likely to find the player than the other two. 251 00:16:26,770 --> 00:16:30,190 And basically these are all the state machines for the three enemy types. 252 00:16:30,190 --> 00:16:31,180 I hope you like them. 253 00:16:31,180 --> 00:16:33,250 Let me know in the comments section down below. 27230

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.