Omniknight

Project Type Individual programming project
Software Used Unity
Languages C#
Project Duration 2 weeks

About Omniknight

Omniknight is a prototype game I developed as the first programming project for my videogame design program. This project helped me to learn a lot of programming concepts, as well as to keep my code clean and modular, since our teacher was very insistent on that. At that time, I wanted to learn how to create a turn-based combat system without going into a battle scene, so that's what I did. Since it's a prototype, it is not very polished, specially in the artistic aspect.

Collecting weapons and energy

The player can pick up weapons and energy to use in future fights, this is important in order to have enough assets to win them.

Fights

The player has 2 permanent fight actions: normal attack to deal damge and shielding to prevent it. There is also 2 limited actions: using a greatsword that deals a lot of damage or using a magical staff to heal himself (limited by the number of greatswords and staffs the player carries). Every action (except for the normal attack) consumes energy, which is restored at the start of each turn and when the player performs normal attacks. Killing enemies permanently grants +1 on damage and heals.

Fight-image

I implemented a waypoint path system for the enemy patrolling. Each enemy has an array of waypoints that is infinitely recursed, the action variable can be changed from "GO" to "STAY" so the enemy stays in that waypoint for a certain amount of time. This path can be customized for each enemy from Unity's inspector.

Waypoints-enemy Waypoints-inspector

The waypoint script has a state machine that runs the corresponding code while the enemy patrols. The ChangeState function override allows for an easy switch on the enemy animation.

I implemented a finite state machine for the enemy AI. Enemies chase the player if inside their detection range, and if they get close enough a fight will start. But if the player exits the chase range, the enemy will go back to patrolling. It also controls the fight and death states.

The RunLogic method gets called every frame in the GameController Update function, doing this allows us to stop all enemy logic easily in scenarios like engaging in combat.