Balancing the Spawn Manager for the Intended UX
The intended experience desired for this game is to have the player constantly moving left and right, at steps as well as continuous sweeps in one direction. The player should feel the left hand dancing through the keys as the player moves, shoots, boosts and evades. The spawn manager throws every game element on screen through the rhythm of separate coroutines. This shooter is intended for players that have fast finger mechanics and are used to this type of games. So let’s balance the system for an aggressive enemy fleet.
- Balanced Spawning
- Player Ammo
- Negative Power Up
- Enemies shooting power ups
As seen in the first article about the spawn manager, the enemy waves have a yield time before spawning the next enemy, and each wave won’t end until all enemies have been killed. This yield event only occurs inside the enemies coroutines; a smart player can leave one enemy alive and replenish from the other coroutines before advancing to the next level.
For all enemies, very often it takes two bullets to destroy it. So the pause time between each common enemy is set to four seconds and the rare enemies to eight. Within every eight seconds of combat, the player needs at least six bullets.
Currently, common enemies wave increases by two enemies while rare increase by one each wave. The end of each wave increases the max ammo, but does not increase the current ammo.
public void AddMaxAmmo()
{
_maxAmmo += 7;
_uiManager.AmmoDisplay(_currentAmmo, _maxAmmo);
}
public void ReloadAmmo()
{
_currentAmmo = _maxAmmo;
_ammoIndicatorRenderer.color = Color.green;
_ammoIndicator.SetActive(true);
_isAmmoReady = true;
_uiManager.AmmoDisplay(_currentAmmo, _maxAmmo);
}
The first ammo prefab spawns at ten seconds of game start, and the following are a random number between ten and twenty. This allows the player to shoot way more than needed and makes a bad accuracy forgivable.
To reflect the increased ammo, this method is called. It’s called when adding, when reloading and whenever the player shoots.
The power ups coroutine has a random time of ten to fifteen seconds. Which makes the game easy and dynamic to constantly test them all. Currently this coroutine has an array of five power ups to spawn.
Having a negative power up balances the frequent instantiation time of power ups by adding a time to avoid collecting items. This experience even blocks a path, as the player wants to avoid flying close to it, or opening up the magnetic force near it. To implement this negative power up, the opposite to the speed power up is implemented.
To balance the possibility of obtaining too many power ups per waves. The enemies can now destroy power ups if this item is touched by any object tagged as “enemy laser”.
else if (other.tag == "Enemy Laser")
{
AudioSource.PlayClipAtPoint(_explosionClip, transform.position);
Destroy(this.gameObject);
}
With this conditional, reaching for a power up in front of an enemy might be dangerous as it might be destroyed before collected, and the player could take damage from the other enemy laser.
Health packs have a random yield time of 25 to 35 seconds, making some game runs harder to to heal during waves. Luckily, health packs and ammo cannot be destroyed by enemy lasers and balances situations where the magnetic field is essential. At this rate of yield times, the system seems balanced and increasing difficulty can now be easily modulated through the max ammo value and amount of enemies values.