# Game A Month - Enemy AI, New Abilities and Level Design [Indie Devlog]

## Метаданные

- **Канал:** Matthew Palaje
- **YouTube:** https://www.youtube.com/watch?v=m3zURBDNVJQ
- **Источник:** https://ekstraktznaniy.ru/video/39504

## Транскрипт

### Segment 1 (00:00 - 05:00) []

hey everyone welcome to game a month four I've spent some more time on the game and developed the enemy AI a cool finish the system where if an enemy's health is ler you can use a finishing move this will give you health and it creates a really cool effect in slow motion and this particle effect then the enemy goes flying this was inspired by doom 2016 we can basically finished an enemy of the glowing and health and Emma drops I also put together a small level prototype so we can test out the combat so the first system that I started adding in was the enemy AI I wanted a very simple behavior for this game so basically what enemies can do is that they can go idle patrol they can then detect the player and go into combat mode I started with the idle and patrol those are the first two systems I pretty much always set up and before I got into creating nodes I had to set up my behavior tree and blackboard so unreal has an amazing system for AI called behavior trees it's a great way to visualize the enemy AI and set up all the behaviors at first I thought the system was complicated when I started using it a few years ago it just seems a bit daunting at times to dive into some of the systems within unreal but if you're hesitating I highly recommend just jumping in it's so easy to create AI with the system and set up tasks and behaviors and visualize it it's really good so with the system in particular I created a blueprint task and this task was all about finding a random point in a reachable radius and that's actually the note I used so it basically just finds a vector that it could Pathfinder in its radius and I set the radius myself the reason I did a random reachable radius is because I don't actually need precision patrol patterns and what I mean by that is in Billiken struct or any stealth game you have to have predictable AI routes you need to be able to learn their patterns and then use that to your advantage so for this game it all about combat that I'm making now this games all that combat the patrol piles they can be completely random so when an enemy reaches their random control point that vector when they actually reach it and overlap with it they will go into idle and the great thing here is there is a task called wait and this will just make the logic stop for a few seconds or whatever you set it to it will kind of block it and wait and because I've set up my blendspace to use the play of the enemy velocity I don't have to play an idle animation or stop the enemy loads or anything like that I simply just use a blend space and because it's waiting its velocities already at zero since move to moved to the random reachable location is not running so that was really great and easy to set up and once I had the patrol and idle all set up I began working on detection so unreal has another component which is very useful called AI perception and it's basically inbuilt code and it has all this stuff for player detection and even things like sound and sights for this game I only need to use site so I focused on setting it up so the view radius was quite right out wide and the distance is fast so enemies can see you when you're kind of moving around and flying and I want enemies to be able to see you from a distance so they can begin just shooting at you with the perception set up I call a function I believe that's called AI perception update target and it just checks if it's sensed the player and from there you can tell the AI to just go straight into combat mode because it's all about fighting I don't have to investigate an area or lose sight of the player basically I can just say hey patrol idle and go fight the player it's a very simple setup so with this simple AI setup I was able to begin play testing straight away the only extra thing that I set up was something called aim offset so with blunt spaces as you found out in the last episode or you probably already know you can blend between movement and aim offset allows you to blend between an enemy aiming up and down so say the player is flying the enemy will actually look up and shoot at the player and it just feels so much better when the enemy actually looks at the player and shoots as opposed to the enemy just looking around on ground level and projectiles magically fly up to the player it actually feels like the aiming and firing at you which is great the only extra thing I set up was auto fire on

### Segment 2 (05:00 - 10:00) [5:00]

the player so if you hold left click down it will reach rigger the fire event I was getting tired of spamming left click so I wanted to make sure you could order fire so you lift your finger wouldn't get tired when you're playing the game so I did my first play test after I set up all the enemy AI and it was really good I gave the enemy HP and made it so my projectile could take their health away I also added a radio force component which I added in last time on the projectiles and that's what makes it everything kind of forced push away so there's an impulse of fires and everything gets blown away and the reason I added this in was because it's way more fun when you take out an enemy and there's a visual result and ragdolls are always entertaining so I made it so it would the enemy would ragdoll and then get blown away by the radio force with the basics of the game setup I wanted to put together a very simple level and I used the super grid starter pack I always use this pack whenever I am prototyping I love the color of the grids and how it looks it's just so much nicer than the default unreal texture I'm so sick of so I wanted to start an area where you could take on enemies and you can fly if you want to you're not forced to you can just run around the ground and take out all the enemies but then I wanted a second section where you fly in order to get there and that takes advantage of the hover system and it also makes the player learn how to fly and shoot at the same time with this setup I also put little blocks around so you could actually take cover and hide behind the walls at this point I was really happy with the progress that I had been making the AI was really fun too sure dad and it was nice to have a level that you could move around and I was considering that I would stop here and just make a youtube video on this but I had one other idea that I wanted to implement and something I like to mess around with and gave a month is to just try out random things and I remembered the finisher system in Doom 2016 where you could basically take an enemy's health flow make them glow and then use a finisher move they're quite brutal it looks really awesome you could use a finisher move and you'll get ammo and health and it's such a great system in order to get health back to the player it really enforces the player to kind of push forward and keep on fighting so I wanted to see what would happen if I implemented it in a game like this would I play a bit more aggressively and try get closer to the enemies in order to regenerate health and I ended up creating this finish system the finisher system was pretty straightforward to create it requires some simple logic so in order to get it working I want to kind of tell you the overall kind of pseudocode I came up with and then I'll show you how I implemented it in blueprints the logic is that you have to get a reference to an enemy near you so you need a maybe do this Kalida to check if you've overlaps with enemies or maybe you want to do a trace severe trace after you do that whatever trace or overlap or collision check you do then you want to see if the enemies health is below a specific amounts and the reason you're checking if it's below is the Civic amount is because you only want to use the finishing move once they're weakened once you've checked that their health is below whatever amount you choose so say you choose 35 you want to stop the enemy shooting and their movement logic so they're kind of stuck in place and once they're stuck in place you also want to stop the player movement we're also gonna be able to move around whilst they do the finishing move once all the inputs and enemy logic is stopped play the animation you want for your finisher move and make sure to cause full damage to an enemy's health so they're taken out in one final hit and increase your health by the amount you want alternatively you could you know make objects fly out of the enemy but I made it so my health would increase by a certain amount keep in mind that I did try and create it in a way that would suit this game it's a third-person game so it's got third-person animations and the timings of course would be different to dooms so if you wanted something more faithful to doom you'd probably want to make it a first-person and try and copy what they did a lot more closely my whole concept when I came up with this idea was just a system where you could freeze anatomy in place do the kind of ultimate ability or finisher ability and they would get blown away and you would get health back there were three other things that I added to the system the first thing that I added and I think this is really important is you want a visual change

### Segment 3 (10:00 - 13:00) [10:00]

for the enemy so I made a simple emissive material that I could apply to the enemy in the future I'd like to make something a bit more advanced but for now the glow was perfect these second was slow motion and the reason I added slow motion is because I wanted it to feel like an epic mode I want you to feel powerful and enjoy the result that you've caused this was done with the global time dilation mode which simply just slows down time so you can set it to zero point to add a delay and set it back to 1 the third thing I added was a particle effect and this was to visualize the powerful attack phases using to destroy the enemy this was fun to add in doom the doom slayer has really brutal animations and that's how they really visualize the power of the doom slayer and what he's doing since I only had a week I kept it simple I just play an animation and I put a really powerful looking particle effect in and that was my way of selling how powerful the character is when they use this finishing move with all of these features combined the final gameplay looks like this I'm really happy with the results of the game so far I like the combination of gameplay elements that I'm creating this time around my next goal is to put an enemy model in not sure what it will be if you have any Paragon recommendations let me know the other thing I want to add in is an environment and a simple objective for the player to complete so I can tie up the overall experience I've been working on this a few hours during specific days of the week my main focus is the VR project that I'm developing for work but it's been really great to take some of my free time and put it into my own creative project I'm really enjoying game a month at the moment if you'd like to join in the future I'm considering starting an itch hire page just a monthly game jam so it's not um it's not a game jam per se it's just if you want to do game a month with me we can submit our games on there submit progress maybe write in the comments section and on my dis card if you'd like to do this kind of thing and just have a small creative project outside of what you might do for work or whatever that you you're doing maybe you actually just want to do game a month full time for a few months I'm not sure but let me know what you think of that idea and if you'd like to join in I've put a build of the game up on HIO I'm using a great service called Butler and it basically updates the game with changes I make so it's kind of like patching it I just run it through command prompt and I upload the zip and it will only upload specific files so this is much better than the old ways to do it just going on each hire and reloading and it doesn't have the same size restrictions so if my game gets over a gigabyte I don't think it's a problem according to what I read I've also added a link to our disco channel in the description below so if you want to join a community of game developers feel free to click on that and if you want to be notified of any future videos I create make sure to press subscribe and you get notifications the last thing that I wanted to cover were that you guys wrote a lot of questions for the QA I was just gonna do a little section at the end of this video to do a small QA but I might go and do a Q&A video so in the past I used to do in the Q&A videos and they were quite fun so I'm probably gonna prepare that for you so you could watch it either this week or next week and if you have any questions feel free to write them on any video I'd love to see if I could add some value and help answer them anyway thank you so much for watching this video I hope you enjoyed it and found it valuable I will see you all in the next video
