top of page

Aliens vs Earth

Project Name: Aliens vs Earth
GitHub: 
Made in third year 2022.
team size: 1
During this project I made this scene where i tested all of my scripts and started to experiment with different kinds of game mechanics.

github.png

Gameplay:

I am working on a first person parkour/shooter game, This is the scene where I started to work on the scripts to make the game as smooth as possible. I wanted to try out many different things such as enemy spawning shooting mechanics and smooth movement and eventually I worked on making different game views such as third person and a top down view with the tab of a button!

Enemy's:

In this project I some enemy AI troops to attack you, so I've been working on that in this project the enemy is very simple so far with an nav-mesh agent it can walk around the map and attack the player by trowing grenades when he get's nearby.

Hostile Turret

Besides enemy's I also decided to add turrets into the game which you can destroy, they will try to stop and kill you on your way out! The turret shoots on a time based bullets in your direction when you get close enough.

Friendly AI

During this project I also wanted to learn more about AI in general, so i started working on a friendly AI units, to give commands to and let him fight the other enemy's in the game. Because of this I felt like I was learning allot more in AI behavior. 

So far the Friendly AI's can patrol through the level, detect enemy's and proceed to follow them. And finally they can attack the enemy AI when they are close enough. So far I put them in a spawner which makes enemy's and friendly's spawn around the map every 5 seconds which create a chaotic battle between the two.

Screenshot (216).png
Screenshot (223).png

Here you can see the top down view it looks good, it flows good with the game and doesn't collide with objects this way nothing can get in your view but the player is still able to hide behind objects in the game. Maybe I will change this in the future but for now it flows nice with the in game view.

Watch the game here!

Code snippets

Hostile Turret

Here you can see the turret script I made it's very simple. The turret checks if the player (you) is in range. If the answer is yes then it proceeds to fire projectiles at the player, those projectiles then proceed to destroy themselves after 10 seconds.

Enemy AI

Here you can see the Enemy AI script, in the script it calls an physics checksphere to check rather or not the player is close this will determine which state the AI is in. so far the AI has 3 states. Patroling, Chasing and Attacking.

In the update method I check rather or not the player and/or the Friendly AI are in close range. This will determine the states which the enemy can find himself in. for example if the player is in sight range but not in attack the enemy will start chasing the player.

Friendly AI

Here you can see the Friendly AI script, in the script it calls an physics checkSphere to check rather or not the player is in range this will determine which state the AI is in. so far the AI has 4 states. Patroling, Chasing, Protecting and Attacking.

For the Patrolling the AI just sets a new random walk point, then it will send the nav-agent to this point, if he reaches that point then the script will generate a new walk point.

Cine-machine cam's

So during this project I had to choose a software element to further develop and master more. I chose to further explore working with cine-machine camera's and make many different types of camera's in one player so I am able to switch between them! Here in the code on the right I call all of the functions needed to turn off and on in my script.

Screenshot (215).png
Screenshot (214).png

Here you can see how I implemented the different camera views, and how I can change them during the game. By pushing on an keycode for example C it starts an if statement that checks if the key is pressed then it will switch the camera style that is binded to the key and turn scripts and camera's off/on to change the view. The on and off switching of scripts is checked using bools which can be either true or false. 

bottom of page