• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Randomised Spawning

Level 14
Joined
Oct 16, 2010
Messages
763
Hi,

I have a map that I've been making for many many years now, concept wise it's a simple "pick hero, defend building, fight waves of enemies" with lots of randomness to it

I've been wondering for a while about changing how the spawning works though, at the moment each round is made up of a certain number of enemies, that increases with round and difficulty. Each spawn rolls various things so the higher the round and difficulty the stronger enemies tend to appear

However I was wondering about the idea of changing it so that each unit had a "cost" and each round had a "budget", then again randomise the chances based on the cost, round number, and/or difficulty

The primary purpose of the change is that currently a wave would spawn 10 units on a round that could be strong/weak and the number of enemies would be unaffected, with this "budget" idea there could be lots of weaker enemies and a couple of stronger enemies, or you would have a wave which is a mass of weak enemies, and the following round be some really strong enemies depending on how the budget gets spent each round. I guess it would work similar to gold/lumber/food costs in the normal game in that you can buy a lot more footman than you can knights for example

I was just wondering if anyone has made any similar wave spawning systems and/or would have any ideas?
 
Hi,

I have a map that I've been making for many many years now, concept wise it's a simple "pick hero, defend building, fight waves of enemies" with lots of randomness to it

I've been wondering for a while about changing how the spawning works though, at the moment each round is made up of a certain number of enemies, that increases with round and difficulty. Each spawn rolls various things so the higher the round and difficulty the stronger enemies tend to appear

However I was wondering about the idea of changing it so that each unit had a "cost" and each round had a "budget", then again randomise the chances based on the cost, round number, and/or difficulty

The primary purpose of the change is that currently a wave would spawn 10 units on a round that could be strong/weak and the number of enemies would be unaffected, with this "budget" idea there could be lots of weaker enemies and a couple of stronger enemies, or you would have a wave which is a mass of weak enemies, and the following round be some really strong enemies depending on how the budget gets spent each round. I guess it would work similar to gold/lumber/food costs in the normal game in that you can buy a lot more footman than you can knights for example

I was just wondering if anyone has made any similar wave spawning systems and/or would have any ideas?
This sounds pretty fun tbh. I have not done something like this, but seems like something that could work for my map in exact same genre.
Should be pretty simple to make a loop, and a few ifs and rolls. I'd probably do it in jass (as I've learned it pretty well over the last ~4 years), but it's 100% doable in GUI.

Just set gold or lumber value of the enemies and use that as "points" for the enemy-type and continue until you have enough points (I'd probably do a loop where I try to get enough points over 500 attempts, and break out of the loop if I manage to get enough points before that)
 
I think what makes most sense, balance-wise, is to have presets of groups that you just slightly modify on the fly (i.e. increase number of some enemies, sometimes spawn a completely different bonus enemy, etc.)
Reason being that although your idea is similar to gold/lumber/food costs, what you are lacking is the human factor which creates a balanced army - something you would not have without a complicated weighting system. Hence why I think presets may be easier.

For example you could have a single high HP caster who has various AoE skills. For such caster spawning also high amount of low-hp melee units may be bad idea. Why? Because either caster's AoE will deal damage to them as well, so lots of them die to friendly fire, or they won't take damage, but then you risk that those units would block players' escape from AoE spells due to collisions.
For such caster a good party may be few moderate HP melee units (perhaps even with stuff like slowing poison) and a bunch of ranged units that would serve as meat shield for the high HP caster.

Another example with problematic groups could even be a simple thing like having few strong high HP melee units accompanied by a large group of weak melee units. They would block one another from attacking players as there would not be enough space around players for all of them.
 
I only got round to playing around with this yesterday, as I said I'm not too fussed about perfect balance as such just wanted to remove the chance for the same number of strong units as wrong units.

I already have round limits for units to spawn on so for now have used that as their "cost" and used another formula to generate the "budget"

Definitely came across some issues already but I think it's working reasonably as intended! Just need to play around with it some more!
 
Hi,

I have a map that I've been making for many many years now, concept wise it's a simple "pick hero, defend building, fight waves of enemies" with lots of randomness to it

I've been wondering for a while about changing how the spawning works though, at the moment each round is made up of a certain number of enemies, that increases with round and difficulty. Each spawn rolls various things so the higher the round and difficulty the stronger enemies tend to appear

However I was wondering about the idea of changing it so that each unit had a "cost" and each round had a "budget", then again randomise the chances based on the cost, round number, and/or difficulty

The primary purpose of the change is that currently a wave would spawn 10 units on a round that could be strong/weak and the number of enemies would be unaffected, with this "budget" idea there could be lots of weaker enemies and a couple of stronger enemies, or you would have a wave which is a mass of weak enemies, and the following round be some really strong enemies depending on how the budget gets spent each round. I guess it would work similar to gold/lumber/food costs in the normal game in that you can buy a lot more footman than you can knights for example

I was just wondering if anyone has made any similar wave spawning systems and/or would have any ideas?
Here you go, I saw your request and made you a map today based on your concept. I believe it works in theory and can be tweaked however you need to fit your needs. I hope this helps. I tried to make it so that a certain number of units (3) of the units spawned get boosted each round if the roll requirement is met. I made the roll requirement equal to the Round X 5 + 30. So Round 1 starts as 35% chance of boosted units. The main thing I am missing is the "budget" aspect but you could factor that into the Variable - Roll Requirement (integer) but I would refer to ThompZon's comment on how to accomplish that part and incorporate it into the system I made.

Some of the triggers involved:
  • Rounds Copy
    • Events
    • Conditions
    • Actions
      • Set VariableSet IntegerRound = (IntegerRound + 1)
      • Game - Display to (All players) the text: (|cff008080Round |r + (String(IntegerRound)))
      • -------- Create Units --------
      • Unit - Create (IntegerRound x 1) Ghoul for Player 4 (Purple) at (Random point in Region 000 <gen>) facing 270.00 degrees
      • Unit - Create (IntegerRound + 1) Necromancer for Player 4 (Purple) at (Random point in Region 000 <gen>) facing 270.00 degrees
      • Unit - Create (IntegerRound + 2) Banshee for Player 4 (Purple) at (Random point in Region 000 <gen>) facing 270.00 degrees
      • Unit - Create 1 Dreadlord for Player 4 (Purple) at (Random point in Region 000 <gen>) facing 270.00 degrees
      • Hero - Set (Last created unit) Hero-level to IntegerRound, Hide level-up graphics
      • -------- Set Variables --------
      • Set VariableSet GroupEnemy = (Units owned by Player 4 (Purple) matching (((Matching unit) is alive) Equal to True).)
      • Set VariableSet IntegerEnemyUnitsLeft = (Number of units in GroupEnemy)
      • Set VariableSet IntegerRoundPercentage = (30 + (IntegerRound x 5))
      • Set VariableSet IntegerCheckBonus = (Random integer number between 1 and 100)
      • Game - Display to (All players) the text: (|cff008080Attribue Bonus Number Rolled: |r + (String(IntegerCheckBonus)))
      • -------- Roll For Bonuses --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntegerCheckBonus Less than or equal to IntegerRoundPercentage
        • Then - Actions
          • Game - Display to (All players) the text: |cffff0000Roll Succ...
          • Unit Group - Pick every unit in (Random 3 units from GroupEnemy) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is A Hero) Equal to True
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 25.00%, 25.00%) with 0.00% transparency
                  • Animation - Change (Picked unit)'s size to (125.00%, 125.00%, 125.00%) of its original size
                  • Unit - Set level of Attribute Bonus for (Picked unit) to 2
                • Else - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 25.00%, 25.00%) with 0.00% transparency
                  • Animation - Change (Picked unit)'s size to (125.00%, 125.00%, 125.00%) of its original size
                  • Unit - Add Item Armor Bonus (+5) to (Picked unit)
                  • Unit - Add Item Damage Bonus (+5) to (Picked unit)
        • Else - Actions
          • Game - Display to (All players) the text: |cffff0000Roll Fail...

What I didn't do but you could do: Alternatively my map doesn't do this but instead of making the units receive a stat bonus use could transform the unit into a stronger version of themselves but this requires creating many versions of each unit (which would not show as a +1/+5/+10).

You give them an aura that marks that they are boosted, instead of changing their color/size.

The concept was based on this idea:
USE ATTRIBUTE BONUS FOR HEROES, DAMAGE/DEFENSE BONUS FOR NON-HEROES

Wave 1:

Likelihood to get Attribue Bonus +5 to all stats, Given to 3 Random Enemy Units

Round 1: 30 + 5 = 35
Round 2: 30 + 10 = 40
Round 3: 30 + 15 = 45
Round 4: 30 + 20 = 50
Round 5: 55
Round 6: 60
Round 7: 65
Round 8: 70
Round 9: 75
Round 10: 80

Wave 2:

Then create new Attribute Bonus +10 to all stats, Alternatively You could Make More Units Get Bonuses Than the Standard 3

Start the Round dice roll back to Round 1's percentages (could alter)

Round 1: 30 + 5 = 35
Round 2: 30 + 10 = 40
Round 3: 30 + 15 = 45
Round 4: 30 + 20 = 50
Round 5: 55
Round 6: 60
Round 7: 65
Round 8: 70
Round 9: 75
Round 10: 80
Warning: The only thing my map doesn't do is fix unit group leaks (I'm not the best with stopping leaks), so if anyone knows how to make my triggers leakless with proper custom script that would be appreciated.

Let me know if this helps. Or if you found a better way, please share!
 

Attachments

Last edited:
Hi again, sorry just got round to looking at this!

I like the concept! You mentioned having multiple stronger types of the same unit, that's how my map is already set out so that's how I've kept it.

I'm currently trying the budget system, it seems to work but because of the increased number of enemies the map is definitely more difficult! Will have to play around with balancing a bit...

To include the budget idea into yours I think I would roll on every unit based on the budget, if a unit is successful then the budget decreases lowering the chance of a future unit to be buffed. Could be an issue there with what order units are picked in a "pick all units" function but I guess we'd sort that later down the line!

But either way thanks for looking into it! Maybe I'll use something like these in a future map!
 
Back
Top