Reasonable Spawning Rule- Game Dev Series 45

Objective: Balance the rules of powerup spawning.

Something must goes wrong.

So far we already have 6 powerups(or 7, including poison) randomly spawning during the game. However, we usually get what we do not need at the right time, that is because the spawning system is messy. We simply add the newest powerup in to the old spawning routine.

In this article, we will fix the balance between all the powerups.

The first part is figuring out what should shows up with higher frequency. When the game just began, you might not need the repair powerup since there are less enemies, which I would set the repair to the lowest frequency.
Furthermore, shield and speed powerups are what players want but not so necessary, I would place them to the middle.
With these figuration, we can sorting the tiers.

  • Tier 1- ammo, triple shot.
  • Tier 2- shield, speed.
  • Tier 3- repair

Now we can adjust the SpawnManager.

SpawnManager

For the original spawning coroutine with detecting enemies and triple shot counts, I would set it as tier 1 spawning rule.

In this coroutine, I use new integer “tier1Powerup” as spawning target.

Notice that you might need to change the powerup ID and replace the prefab in SpawnManager editor if you change the spawning frequency like mine.

The next is to extract tier 2 and 3 into separate coroutine.
Tier 2 is quite easier, we just need to set a delay at the beginning so it will not mix the spawning into tier 1.

Remember, the waiting seconds should be different with tier 1, with a longer spawning gap time.

With tier 3, we should set some rules on spawning. We will need this powerup when the numbers of enemies is quite a lot. To do this, we can simply use the integer of counts spawned normal enemies to control the spawning frequency.

Then, don’t forget to start these coroutine at StartSpawning().

All done! You can always change the random spawning time to get a well-balanced game experience.

--

--

--

A passionate gamer whose goal is to work in video game development.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Bubble System BIOS Download

How to Install nvm, node and yarn for your Ruby on Rails Application

Install Tensorflow Object Detection API for Ubuntu 18.04

A Cooldown System- Game Dev Series 07

Task1 of Hybrid Multi Cloud launching a web server using terraform and aws

Afraid of Lightning?

Loading Payroll Calculation Cards using Spreadsheet Loader (HSDL)- Yes it’s not only possible but…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
S.J. Jason Liu

S.J. Jason Liu

A passionate gamer whose goal is to work in video game development.

More from Medium

Adding a player ammo indicator to the UI

Upgrading A Unity Project To The Universal Render Pipeline (URP)

Daily Progression: Generate a Case Number!

From Start to Finish Part 3: Waves