Search Unity

Tutorial - How to Implement Weighted Random Enemy Spawning with Spawn Configuration ScriptableObject

Discussion in 'Community Learning & Teaching' started by ChrisKurhan, Jul 6, 2021.

  1. ChrisKurhan

    ChrisKurhan

    Joined:
    Dec 28, 2015
    Posts:
    268


    Hey all! Happy #TutorialTuesday!

    This week is Part 20 of the AI Series where we'll be taking a look at a new spawn method - weighted random. This allows us to give a less uniform gameplay experience to our players by having different enemies have different weights that we can configure as granular as we'd like. I've personally implemented this in my game - Llama Survival to have different enemies more heavily weighted at higher levels to make the game more challenging than at lower levels. These configurations also change based on the player's selected difficulty.

    As always, full project code is available on GitHub!

    If you're getting value from this series, please consider liking and subscribing to help these tutorials reach and add value to even more people! New tutorials every Tuesday, sometimes on other days too.