December 3

Asymmetrical Game (H.A.C.K.E.D) Part 2

One of the main elements of H.A.C.K.E.D’s development from my perspective was the creation of its enemies and my foray into Enemy Pathing.

screen-shot-2016-12-03-at-14-42-31

One thing that becomes immediately clear about the game’s stage is that it is filled with twisting turns and corners, so simple scripts to move them towards the players wouldn’t cut it, not alone anyway.

With was most of my time with the game’s development: Making the Enemy’s Pathfinding AI. At first I tried using Unity’s NavMesh Agent to guide the enemies to the player, but it presented some issues. Framerate would take a deep dive into the abyss of lag, and the movement wasn’t fulfilling my objectives for the game.

I then tried Astar Pathfinding, but the time constraints the game found itself prevented me from being able to learn the plugin to use it in a satisfying manner.

I finally decided to make a simple behaviour for the enemies with my own script. I used raycast that would work akin to how people use hands to figure out where to go when on a hallway in the dark. One would be in front, checking if there is a wall in the front, while 2 on the sides would check if there are any walls on the sides. When the player would reach a wall on the front, it would move depending on which walls were free: if there was one a wall on one side, it would go the the opposing direction; and if there were no walls, it would randomly choose a direction, adding randomness to its behaviour.

screen-shot-2016-12-03-at-14-41-11

This game gave me a good challenge in terms of AI, but I wouldn’t say I’m too fond of it. To be fair, the development of the game was rather stressful. I still enjoyed coding what I did.


Posted December 3, 2016 by huizl151 in category FY

Leave a Comment

Your email address will not be published. Required fields are marked *

*