Devblog 1

Devblog 1

-Introduction -AI Programming -Animations

Photo by Ravi Palwe on Unsplash

Hi, I'm Mac and let me present to you this game I've been working on for the past year. So I decided to build an FPS Military campaign game that will be highly story-based. I went with this genre because I really enjoyed playing games like Call of Duty and CSGO. Even though this game is highly inspired by these two massive franchises, I believe it will provide you with a new experience and I really hope you like it. These Dev blogs are meant to document my Journey in developing and releasing this game and I will do everything to make them as entertaining as possible while at the same time educating you by showing you the behind-the-scenes of game development and how I go about implementing the various features. So without further ado, let's dive into it.

THE PREVIOUS WEEK

So these Devblogs are supposed to be weekly blog posts where I talk about the development of the game. The reason why I am talking about this previous week is that it will help you understand all that happened this week. So this previous week I decided to create more enemies for the game. I already had an enemy for the game but everything was wrong with it. First of all, it had a shitty AI code, it had an uninteresting behavior (Basically all it did was follow the player around while shooting it) and I think the player would have gotten bored of seeing the same kind of enemy over and over, plus it didn't make for very great gameplay so I decided to code more enemies. But as you can imagine, everything that could have gone wrong, went wrong. This is a summary of this past week :

Monday 18th July 2022

I was about to get started on writing the algorithm for the different enemies and then BIM! Power Outage(Which lasted the whole day by the way), but it's ok, I will continue tomorrow and crush my to-do list

Tuesday 19th July 2022

Felt extremely burned out from working non-stop on the game for the past 2 months and decided to take the day off and get some rest, but it's ok, I will continue tomorrow and crush my to-do list.

Wednesday 20th July 2022

Another Power Outage but it's ok, I will continue tomorrow and crush my to-do list. The rest of the week was basically me just procrastinating and telling myself that everything will be fine the next day. All I did was just Update my Medium Profile page which you can check here by the way. But the following week was much more interesting.

THIS WEEK

So this week has been way more productive and I basically got everything concerning the AI done.

Monday 25th July 2022

I got started on programming the AI for the different enemies today. I wanted to have 4 enemies in the game:

-Soldiers on the Roofs

-Soldiers at the windows

-A Patrolling soldier

-A stationary guard

The reason why I did not program a single enemy with all these behaviors was to save performance. So I got started on programming their AIs and I got stuck on one single Stupid!! problem when trying to make the enemy face the player when the player gets close. It took me the rest of the day to figure out. You might think it is one serious programming problem but the solution to it , well, ... Check it out by yourself

This is the code before the solution was found

Screenshot 2022-07-29 231214.png And this is the code with the solution implemented. Can you spot the difference?

Screenshot 2022-07-29 231043.png For those wondering, I use C# as programming language which is the default programming language for Unity Yeaaahh, as I said, STOOPID !!! But I was too tired to continue for the day so I decided to continue the next day

Tuesday 26th July 2022

So today I decided to continue programming the AI for the different enemies. This was fairly simple since Unity has a Fantastic! Navigation system that facilitates everything. At the end of the day, our Patrolling Soldier could patrol, the stationary guard could chase the player from the moment he sees it even though now he just looks like he wants to give us a big hug

Screenshot 2022-07-29 221441.png

...but I promise I will make him look much more terrifying later on. I also tried to implement shooting but this was much more complicated than what I imagined. I tried a lot of things but none of them worked so I decided to post pone it to tomorrow. At the end of the day, I felt really good, even though I could not finish coding all the enemy behaviors at least I got through most of my to-do list which is great.

Wednesday 27th July 2022

I woke up this day feeling very happy, the progress we made the previous day motivated me and so I was very eager to get back to work. So after my daily prayer and finishing my daily chores, it was time to start working. The plan for today was to start working on animating the enemies but since yesterday I got stuck when implementing the shooting behavior of the player, I decided to try and fix that today. Long story short, it took me the whole day and as you can now see, all the enemies can now shoot the player accurately. Screenshot 2022-07-29 221845.png This is a statement from the Debug Window

  Basically what happens here is that since the enemy will be facing the player when attacking it, all I have to do is to shoot a ray in the forward direction and it will directly touch the player. And if you are asking yourself about all the enemies that will be in height, don't worry, I got that covered. 

Thursday 28th July 2022

So today is the big day, I will animate the enemies. I am really looking forward to this. I used to hate animations but since I developed the new method for animating, it really made everything so simple. The reason why I am looking forward to this so much is that I really believe it will make the game look much more alive. SO I should get started. I finished adding all the animation I downloaded from mixamo to all the characters. And it is really fun. But another problem is that I need to find a way to make the gun animations play at the same time as the soldier animations. After searching in outer space (Google) for some time(Several hours) I found a very easy way to do that and it is just to add the gun property to the soldier animations and animate the guns.

Screenshot 2022-07-29 222222.png

This worked perfectly and now the game starts to look like an actual game and it makes me feel really happy. After thinking about solutions to those problems, what I need right now is to relax and watch a movie.

Friday 29th July 2022

I am writing this article. Thank you very much for reading it, it means so much to me that you actually took the time to read all of this. I really hope you enjoyed it. Don't forget to subscribe if you want to see more and also check out my other series, I think you might find a ton of useful information there. You can join my discord server, the McDev server here to continue the discussion. Don't forget to leave a comment down below and I will see you all Next week.