Spawning different enemy types for progression

I all.

I would love your input on a spawning logic for enemies. ( Think of example nuclear throne enemy spawning )

I have the following.
Main menu where I can choose 4 levels.
each levels difficulty goes up by 1. so 1 to 4
I call these World difficulty Multipliers (WD)

Then each world has levels 1 to 6 as example before you hit the boss room.(LD) is goes up + (WD) for each level ( Just Adding Maybe Mutiplier will work better )

I have the possibility of 5 types of enemies. Lets go just 3 for now to keep it simple.

So it is as I play World 1 is would be WD,LD = Difficulty
example
World 1
1,1=2
1,2=3
1,3=4
1,4=5
etc

World 2
2,1=3
2,2=4
2,3=5
etc

What I need to get is.
Level 1
enemies type 1 can spawn in the first area and qty is ?? 100% Rate
Level 2
enemies type 1 can spawn in the first area and qty is ?? 80% Rate
enemies type 2 can spawn in the first area and qty is ?? 20% Rate
Level 2
enemies type 1 can spawn in the first area and qty is ?? 50% Rate
enemies type 2 can spawn in the first area and qty is ?? 30% Rate
enemies type 3 can spawn in the first area and qty is ?? 20% Rate

etc.

So enemy count should increase according to difficulty total as guideline and type should change the deeper you go into the world.

Am I trying to complicate this? Would like to hear from you.




Comments

  • My suggestion: just hard-code values for a few levels, maybe 10-20 for what suits your game, and then playtest that. Want it to be a bit random? Add 3-5 hard-coded options that are picked from for each level. It'll take you less time to get in, it's much easier to control it precisely, and you can then complicate it and add more control as you need it later. Chances are good that once you start to playtest it you realise you need something a bit different from what you originally thought.
  • I am not sure, but I have an opinion :) It seems like the right approach. Linear difficulty scaling/level progression seems to be the standard in games. In Slay the spire, for example, you climb levels/floors in a similar fashion and it is expected that you will progressively face enemies that hit your health pool harder and have more enemies and higher health pools/abilities themselves that you have to counter to succeed. I am not a fan of linear games per se, so I enjoy open world type of games more. Eve online has a rating system to warn a player of the difficulty of a system ahead, but does not restrict access. It is more interesting to have the choice where and when I explore personally. The options/tools available to the player versus the area/difficulty we happen to find ourselves in and being allowed to use the tools/abilities we have collected on the linear/non-linear path to the ultimate game goal. I want to be over-powered in some and under-powered in others to feel the risk/reward system the game presents. Adding some randomisation, within reason, per area is interesting, but it almost always seems to come down to those tools/options the player has available to them (having collected it , chosen it, bought it, or were given it), so they can customise the outcome, their way, in any area of their choosing, if possible.
  • Thank you both for your feedback.

    Did some thinking and came up with this.

    So this is just to start as a base for now.

    Just using for testing 3 spawn points. So excuse the guys all over each other.

    image

    * Scalable enemy qty for the world.
    * The chance to spawn the enemy.
    * Once spawned how long before it can spawn again.

    Maybe expand this for items drops too. Let say you see the player is struggling to kill the enemies have a unique item spawn.

    What I ended up with.

    image

    To do
    * Using my word and level system in modify these values.
    * Set a Limit to the spawn qty.

    Any Idea to expand this maybe? If anybody want to see the code . Let me know.




  • I think that's probably perfect for now, and always something you can come back to revisit later :)
    Thanked by 1dark_seth
  • I think that's probably perfect for now, and always something you can come back to revisit later :)
    Agree. Don't get stuck on one thing. Normally my problem.

  • Inspector values are pretty clear for where you are going. I love the art. I know t's early but, daaamn. I am a simple person... sees beautiful 2D art... drool happens :)
    Thanked by 1dark_seth
  • konman said:
    Inspector values are pretty clear for where you are going. I love the art. I know t's early but, daaamn. I am a simple person... sees beautiful 2D art... drool happens :)
    Thank you. Will be posting my Game Idea soon.

    Heavy inspired by Nuclear Thrones but with some history behind it! Hoping to get a playable concept out along it.
  • Got this integrated to my World generator. This code is available in anybody needs it in the future.


    This is the base I worked of from. This work as standalone.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class EnemySpawningDefaultforOtherProjects : MonoBehaviour
    {
    
        [System.Serializable]
        public class enemy
        {
    
            public string name;
            public GameObject prefab;
            public float chance;
            public float delayTime; //a delay before they can start spawning
    
        }
    
        public Transform[] points;
        public enemy[] enemies;
        public float spawnDelay = 1.0f; //affected by difficulty ?
    
        enemy chosenEnemy;
    
        float random;
    
        float cumulative;
        public string selectedEnemy; //debug
    
        public int worldMultiplier =1;
        public int levelMultiplier =1;
        public int totalEnemies=10;
        public int enemyQtyMulitplier = 1;
    
        void Start()
        {
            //Adjsut QTY on Enemies according to level and world Multiplier
    
            if (levelMultiplier > 1)
            {
                
                enemyQtyMulitplier = Mathf.RoundToInt(((worldMultiplier + levelMultiplier) + 0.5f ) / 2);
            }
            totalEnemies = totalEnemies * enemyQtyMulitplier ;
    
    
            //adjust spawnrate and chance for enemies
            for (int i = 0; i < enemies.Length; i++)
            {
                enemies[i].chance = (((((float)worldMultiplier + (float)levelMultiplier) / 2) * enemies[i].chance) / 1.6f);
            }
    
    
    
    
                InvokeRepeating("SpawnRandom", 1f, 1f); //might be temp
        }
    
        void Update()
        {
    
            if (totalEnemies <= 0)
            {
                CancelInvoke("SpawnRandom"); //might be temp
            }
    
        }
    
        void SpawnRandom()
        {
    
            random = Random.value;
            cumulative = 0f;
    
            for (int i = 0; i < enemies.Length; i++)
            {
                cumulative += enemies[i].chance;
                if (random < cumulative && Time.time >= enemies[i].delayTime)
                {
                    selectedEnemy = enemies[i].name;
                    chosenEnemy = enemies[i];
                    Debug.Log("picked " + selectedEnemy);
                    break;
                }
            }
    
            Instantiate(chosenEnemy.prefab, points[Random.Range(0, points.Length)].position, points[Random.Range(0, points.Length)].rotation);
            totalEnemies--;
        }
    }

    Thanked by 1konman
Sign In or Register to comment.