Most games in the industry follow a certain path of progression. You begin playing, learn the rules, test your skills as you begin to understand and improve, and then face a challenge. Bosses are a very common example of the “challenge” part of this.
Bosses usually display stronger capabilities than the previously encountered opposition, they can contain elements from recent challenges that you’ve recently overcome, and they usually throw in something unique to make the encounter stand out.
For my 2.5D Space Shooter game, I built an enemy boss AI that utilizes rotating turrets that follow the player and fire…
Over time, every programmer will be faced with countless situations in which they have to figure out “WHY” something is or isn’t performing the actions that are desired. It is in situations like these that proper “Debugging” can save your work and in some cases, your sanity.
To start, there is a simple line of code that can be implemented almost anywhere in your script for use as a triggered identifier.
If you put this line of code in your script, it will type the text that you put in the parenthesis into your Unity Console. With that, you can…
In a lot of games, you will encounter enemy AI that detects the player’s actions and tries to counter them. In Halo if you throw a grenade, the Elite enemy type will attempt to dive out of the way in order to avoid taking damage. So what would that logic look like?
In order for an enemy to react, they will need some sort of trigger to react to. In this case, I am using the same colliders that I used/addressed in a previous article for enemies to detect powerups that are in front of them. I then just added an alternative method that is called in Update instead of the regular movement calculations if a laser is detected in front of them.
No matter who you are, there is a strong sense of satisfaction when you are able to find that zone. When you can breeze through complex tasks with ease because you’ve become skilled enough to do just that! The Batman Arkham games utilize snaps in combat to smooth transitions between targets during fights. This is used to take away the parts of combat that don’t support the “Core Feelings” that the mechanics in the game are trying to display. …
Adding challenge to a game can be difficult. If you make something too hard too early, the game can feel overwhelming or punishing. Not enough challenge and it can become boring, tedious, or repetitive.
Do you wanna know the secret to navigating this maze?
Well, there isn’t one. The best advice I can give is to test early and test often. Get feedback from your friends, family, or coworkers. Play it through yourself, and then play through it again.
On the technical side of things, as we love to discuss here, you can look at difficulty as scalable and fluid…
It seems that most forms of enemy AI these days are developed with some form of detecting the player. Some use sounds, while others use sight, etc.
But how is this done?
The simplest answer is: “Colliders”.
If the player steps over an invisible tripwire around the enemy, then the enemy becomes alerted to their presence. This is often referred to as the enemy's “Cone of Vision” because a lot of developers utilize a “Cone” type shape for their colliders that can detect the player.
The more advanced the AI, the more parameters and collisions go into this feature. From…
Something that you gotta keep in mind when working with collisions is the priority levels of the collider components that you add. If you have a collider on a parent object, and another collider on the child object, the parent will detect collisions made by the child, but the child will not detect collisions made by the parent.
This is important when you are applying your scripts as well since you will have to take these factors into account when handling the collisions within your scripts.
So I started work on a new enemy for my 2.5D Space Shooter game…
When you begin development on a system for your game that involves the spawning of loot, powerups, enemies, or whatever, it is important to take “Balance” into account. Too many enemies of one type and not another can imbalance your combat or make it feel basic and unimpressive. Equal chances in loot distribution can counteract an attempt at creating rarity/more valuable items.
In order to make a system that fits your specific needs, you will need to add parameters that dictate higher chances for some things to happen and lower chances for others. This can be done by using random…
When you play a game, combat can become repetitive unless there are aspects of it that feel diverse or unexpected. By incorporating different enemies that utilize different moves, weapons, and animations you can create all sorts of scenarios to challenge and entice your players.
For my Space Shooter game, I am incorporating an enemy that will fly in from the side stop, stop at a random location on the X-axis, fire between 2–4 heat-seeking missiles, and then fly off.
To make these missiles follow the player I will have to create a reference to the player object and get its…
A common approach to combat in games that is akin to the Arcade Genres of old utilizes a mechanic to spawn sets of enemies into the game at certain points. This is used to create a reprieve between stints of combat, as well give the player a feeling of accomplishment and/or progress.
For this example, I will be using a mixture of loops within coroutines to allow for delayed time intervals with WaitForSeconds().
When called upon, this coroutine checks if the player is alive with the “_stopSpawning” boolean variable. Then it begins spawning one enemy per second until it has…
Hi, my name is Adam Reed and I am a software engineer specializing in Unity and C# development. Feel free to scroll through and check out some of my work!