• 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.

Probability Advice

Status
Not open for further replies.
Level 14
Joined
Oct 16, 2010
Messages
749
Hi all,

Hit an issue in my map and I can't think of a way around that I'm happy with...

So my issue is how enemies fought are randomized, it's based on the current round and the difficulty. So later rounds harder enemies spawn.

However I also made each unit have different "tiers" that can spawn based on difficulty & round again.

So let's make an example...

Unit 1 has 50 spawn rate
Unit 2 has 200 spawn rate

If the round & difficulty get too high then Unit 2 becomes more common, but the higher tiered versions of Unit 1 are actually stronger, which then makes the game easier...

Hope that makes sense..? Any ideas??
 
Level 11
Joined
Jun 2, 2004
Messages
849
It seems you have two dimensions that are changing here: the relative spawn rates of creeps and their tiers. To simplify things, you should get rid of one of them.

So, either keep spawn rates for each type of unit the same throughout the game and update their tiers only, or you can get rid of the concept of tiers and just have a large pool of unit types where each individual type has a different spawn rate based on the difficulty and round number (weak enemies would eventually have a spawn rate of 0 and strong ones would start at 0).
 
Level 14
Joined
Oct 16, 2010
Messages
749
Thanks for the suggestion, I've just been trying to create a different method to get to each spawns. By running the spawns in tier order, in my head it could work. The idea of Tiers was that you would fight the same unit just a stronger version of it, with each tier having a really high spawn rate to match their stat bonuses (in some sense). Have posted the 2 triggers to compare new to old, what do you think?

  • Bandits Marauders
    • Events
    • Conditions
    • Actions
      • Set LootSystem_MaxIndex = (LootSystem_MaxIndex + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 150) Less than or equal to (RoundNo x Difficulty)
          • RoundNo Greater than 20
          • (Random integer number between 1 and 5) Less than or equal to (RoundNo - 20)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 20) Less than or equal to (RoundNo - 20)
              • Difficulty Greater than or equal to 6
              • (Random integer number between 1 and 10000) Less than or equal to (RoundNo x Difficulty)
            • Then - Actions
              • Unit - Create 1 Overlevelled Marauder (6) for Player 9 (Gray) at TempPoint facing Default building facing degrees
              • Set LootSystem_Real[LootSystem_MaxIndex] = 117.00
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • (Random integer number between 1 and 19) Less than or equal to (RoundNo - 50)
                          • RoundNo Greater than 50
                      • And - All (Conditions) are true
                        • Conditions
                          • RoundNo Greater than 31
                          • Difficulty Greater than or equal to 3
                          • (Random integer number between 1 and 2500) Less than or equal to (RoundNo x Difficulty)
                • Then - Actions
                  • Unit - Create 1 Violent Badass Marauder (3) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                  • Set LootSystem_Real[LootSystem_MaxIndex] = 46.80
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RoundNo Greater than 26
                      • Difficulty Greater than or equal to 2
                      • (Random integer number between 1 and 1000) Less than or equal to (RoundNo x Difficulty)
                    • Then - Actions
                      • Unit - Create 1 Angry Badass Marauder (2) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                      • Set LootSystem_Real[LootSystem_MaxIndex] = 19.50
                    • Else - Actions
                      • Unit - Create 1 Badass Marauder (1) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                      • Set LootSystem_Real[LootSystem_MaxIndex] = 7.80
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 125) Less than or equal to (RoundNo x Difficulty)
              • RoundNo Greater than 14
              • (Random integer number between 1 and 5) Less than or equal to (RoundNo - 14)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • (Random integer number between 1 and 19) Less than or equal to (RoundNo - 50)
                          • RoundNo Greater than 50
                      • And - All (Conditions) are true
                        • Conditions
                          • RoundNo Greater than 22
                          • Difficulty Greater than or equal to 3
                          • (Random integer number between 1 and 1750) Less than or equal to (RoundNo x Difficulty)
                • Then - Actions
                  • Unit - Create 1 Nomad Toaster (3) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                  • Set LootSystem_Real[LootSystem_MaxIndex] = 33.75
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RoundNo Greater than 19
                      • Difficulty Greater than or equal to 2
                      • (Random integer number between 1 and 700) Less than or equal to (RoundNo x Difficulty)
                    • Then - Actions
                      • Unit - Create 1 Nomad Burner (2) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                      • Set LootSystem_Real[LootSystem_MaxIndex] = 14.06
                    • Else - Actions
                      • Unit - Create 1 Nomad Pyro (1) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                      • Set LootSystem_Real[LootSystem_MaxIndex] = 5.63
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Less than or equal to (RoundNo x Difficulty)
                  • RoundNo Greater than 9
                  • (Random integer number between 1 and 5) Less than or equal to (RoundNo - 9)
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • And - All (Conditions) are true
                            • Conditions
                              • (Random integer number between 1 and 19) Less than or equal to (RoundNo - 50)
                              • RoundNo Greater than 50
                          • And - All (Conditions) are true
                            • Conditions
                              • RoundNo Greater than 15
                              • Difficulty Greater than or equal to 3
                              • (Random integer number between 1 and 1125) Less than or equal to (RoundNo x Difficulty)
                    • Then - Actions
                      • Unit - Create 1 Champion Marauder (3) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                      • Set LootSystem_Real[LootSystem_MaxIndex] = 23.40
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RoundNo Greater than 12
                          • Difficulty Greater than or equal to 2
                          • (Random integer number between 1 and 450) Less than or equal to (RoundNo x Difficulty)
                        • Then - Actions
                          • Unit - Create 1 Noble Marauder (2) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                          • Set LootSystem_Real[LootSystem_MaxIndex] = 9.75
                        • Else - Actions
                          • Unit - Create 1 Elite Marauder (1) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                          • Set LootSystem_Real[LootSystem_MaxIndex] = 3.90
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random integer number between 1 and 75) Less than or equal to (RoundNo x Difficulty)
                      • RoundNo Greater than 4
                      • (Random integer number between 1 and 5) Less than or equal to (RoundNo - 4)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • And - All (Conditions) are true
                                • Conditions
                                  • (Random integer number between 1 and 19) Less than or equal to (RoundNo - 50)
                                  • RoundNo Greater than 50
                              • And - All (Conditions) are true
                                • Conditions
                                  • RoundNo Greater than 7
                                  • Difficulty Greater than or equal to 3
                                  • (Random integer number between 1 and 500) Less than or equal to (RoundNo x Difficulty)
                        • Then - Actions
                          • Unit - Create 1 Bandit Executioner (3) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                          • Set LootSystem_Real[LootSystem_MaxIndex] = 13.80
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • RoundNo Greater than 6
                              • Difficulty Greater than or equal to 2
                              • (Random integer number between 1 and 200) Less than or equal to (RoundNo x Difficulty)
                            • Then - Actions
                              • Unit - Create 1 Bandit Murderer (2) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                              • Set LootSystem_Real[LootSystem_MaxIndex] = 5.75
                            • Else - Actions
                              • Unit - Create 1 Bandit Killer (1) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                              • Set LootSystem_Real[LootSystem_MaxIndex] = 2.30
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • And - All (Conditions) are true
                                • Conditions
                                  • (Random integer number between 1 and 19) Less than or equal to (RoundNo - 50)
                                  • RoundNo Greater than 50
                              • And - All (Conditions) are true
                                • Conditions
                                  • RoundNo Greater than 3
                                  • Difficulty Greater than or equal to 3
                                  • (Random integer number between 1 and 125) Less than or equal to (RoundNo x Difficulty)
                        • Then - Actions
                          • Unit - Create 1 Bandit Outlaw (3) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                          • Set LootSystem_Real[LootSystem_MaxIndex] = 7.52
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • RoundNo Greater than 2
                              • Difficulty Greater than or equal to 2
                              • (Random integer number between 1 and 50) Less than or equal to (RoundNo x Difficulty)
                            • Then - Actions
                              • Unit - Create 1 Bandit Goon (2) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                              • Set LootSystem_Real[LootSystem_MaxIndex] = 3.13
                            • Else - Actions
                              • Unit - Create 1 Bandit Thug (1) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                              • Set LootSystem_Real[LootSystem_MaxIndex] = 1.25
      • Set LootSystem_Unit[LootSystem_MaxIndex] = (Last created unit)
      • Unit Group - Add (Last created unit) to EnemyGroup
      • Unit - Order (Last created unit) to Attack-Move To EnemyAttackPoint

  • Bandits Maraurders 2
    • Events
    • Conditions
    • Actions
      • Set LootSystem_MaxIndex = (LootSystem_MaxIndex + 1)
      • Set TempBoolean = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBoolean Equal to False
          • Difficulty Greater than or equal to 6
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RoundNo Greater than 20
              • (Random integer number between 1 and 20) Less than or equal to (RoundNo - 20)
              • (Random integer number between 1 and 10000) Less than or equal to (RoundNo x Difficulty)
            • Then - Actions
              • Set TempBoolean = True
              • Unit - Create 1 Overlevelled Marauder (6) for Player 9 (Gray) at TempPoint facing Default building facing degrees
              • Set LootSystem_Real[LootSystem_MaxIndex] = 117.00
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Difficulty Greater than or equal to 3
          • TempBoolean Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • (Random integer number between 1 and 19) Less than or equal to (RoundNo - 50)
                      • RoundNo Greater than 50
                  • And - All (Conditions) are true
                    • Conditions
                      • RoundNo Greater than 31
                      • (Random integer number between 1 and 2500) Less than or equal to (RoundNo x Difficulty)
            • Then - Actions
              • Set TempBoolean = True
              • Unit - Create 1 Violent Badass Marauder (3) for Player 9 (Gray) at TempPoint facing Default building facing degrees
              • Set LootSystem_Real[LootSystem_MaxIndex] = 46.80
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • (Random integer number between 1 and 19) Less than or equal to (RoundNo - 50)
                          • RoundNo Greater than 50
                      • And - All (Conditions) are true
                        • Conditions
                          • RoundNo Greater than 22
                          • (Random integer number between 1 and 1750) Less than or equal to (RoundNo x Difficulty)
                • Then - Actions
                  • Set TempBoolean = True
                  • Unit - Create 1 Nomad Toaster (3) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                  • Set LootSystem_Real[LootSystem_MaxIndex] = 33.75
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • And - All (Conditions) are true
                            • Conditions
                              • (Random integer number between 1 and 19) Less than or equal to (RoundNo - 50)
                              • RoundNo Greater than 50
                          • And - All (Conditions) are true
                            • Conditions
                              • RoundNo Greater than 15
                              • (Random integer number between 1 and 1125) Less than or equal to (RoundNo x Difficulty)
                    • Then - Actions
                      • Set TempBoolean = True
                      • Unit - Create 1 Champion Marauder (3) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                      • Set LootSystem_Real[LootSystem_MaxIndex] = 23.40
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • And - All (Conditions) are true
                                • Conditions
                                  • (Random integer number between 1 and 19) Less than or equal to (RoundNo - 50)
                                  • RoundNo Greater than 50
                              • And - All (Conditions) are true
                                • Conditions
                                  • RoundNo Greater than 7
                                  • (Random integer number between 1 and 500) Less than or equal to (RoundNo x Difficulty)
                        • Then - Actions
                          • Set TempBoolean = True
                          • Unit - Create 1 Bandit Executioner (3) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                          • Set LootSystem_Real[LootSystem_MaxIndex] = 13.80
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • And - All (Conditions) are true
                                    • Conditions
                                      • (Random integer number between 1 and 19) Less than or equal to (RoundNo - 50)
                                      • RoundNo Greater than 50
                                  • And - All (Conditions) are true
                                    • Conditions
                                      • RoundNo Greater than 3
                                      • (Random integer number between 1 and 125) Less than or equal to (RoundNo x Difficulty)
                            • Then - Actions
                              • Set TempBoolean = True
                              • Unit - Create 1 Bandit Outlaw (3) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                              • Set LootSystem_Real[LootSystem_MaxIndex] = 7.52
                            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Difficulty Greater than or equal to 2
          • TempBoolean Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RoundNo Greater than 26
              • (Random integer number between 1 and 1000) Less than or equal to (RoundNo x Difficulty)
            • Then - Actions
              • Set TempBoolean = True
              • Unit - Create 1 Angry Badass Marauder (2) for Player 9 (Gray) at TempPoint facing Default building facing degrees
              • Set LootSystem_Real[LootSystem_MaxIndex] = 19.50
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RoundNo Greater than 19
                  • (Random integer number between 1 and 700) Less than or equal to (RoundNo x Difficulty)
                • Then - Actions
                  • Set TempBoolean = True
                  • Unit - Create 1 Nomad Burner (2) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                  • Set LootSystem_Real[LootSystem_MaxIndex] = 14.06
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RoundNo Greater than 12
                      • (Random integer number between 1 and 450) Less than or equal to (RoundNo x Difficulty)
                    • Then - Actions
                      • Set TempBoolean = True
                      • Unit - Create 1 Noble Marauder (2) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                      • Set LootSystem_Real[LootSystem_MaxIndex] = 9.75
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RoundNo Greater than 6
                          • (Random integer number between 1 and 200) Less than or equal to (RoundNo x Difficulty)
                        • Then - Actions
                          • Set TempBoolean = True
                          • Unit - Create 1 Bandit Murderer (2) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                          • Set LootSystem_Real[LootSystem_MaxIndex] = 5.75
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • RoundNo Greater than 2
                              • (Random integer number between 1 and 50) Less than or equal to (RoundNo x Difficulty)
                            • Then - Actions
                              • Set TempBoolean = True
                              • Unit - Create 1 Bandit Goon (2) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                              • Set LootSystem_Real[LootSystem_MaxIndex] = 3.13
                            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBoolean Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 150) Less than or equal to (RoundNo x Difficulty)
              • RoundNo Greater than 20
            • Then - Actions
              • Unit - Create 1 Badass Marauder (1) for Player 9 (Gray) at TempPoint facing Default building facing degrees
              • Set LootSystem_Real[LootSystem_MaxIndex] = 7.80
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 125) Less than or equal to (RoundNo x Difficulty)
                  • RoundNo Greater than 14
                • Then - Actions
                  • Unit - Create 1 Nomad Pyro (1) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                  • Set LootSystem_Real[LootSystem_MaxIndex] = 5.63
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random integer number between 1 and 100) Less than or equal to (RoundNo x Difficulty)
                      • RoundNo Greater than 9
                    • Then - Actions
                      • Unit - Create 1 Elite Marauder (1) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                      • Set LootSystem_Real[LootSystem_MaxIndex] = 3.90
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Random integer number between 1 and 75) Less than or equal to (RoundNo x Difficulty)
                          • RoundNo Greater than 4
                        • Then - Actions
                          • Unit - Create 1 Bandit Killer (1) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                          • Set LootSystem_Real[LootSystem_MaxIndex] = 2.30
                        • Else - Actions
                          • Unit - Create 1 Bandit Thug (1) for Player 9 (Gray) at TempPoint facing Default building facing degrees
                          • Set LootSystem_Real[LootSystem_MaxIndex] = 1.25
        • Else - Actions
      • Set LootSystem_Unit[LootSystem_MaxIndex] = (Last created unit)
      • Unit Group - Add (Last created unit) to EnemyGroup
      • Unit - Order (Last created unit) to Attack-Move To EnemyAttackPoint
 
Level 13
Joined
May 13, 2017
Messages
163
I didn't get everything you said there but if you haven't, you can take a look at how the Rexxar Campaign spawning system is done. The enemy spawns are scaled up based on your heroes' level. It's a really good system in my opinion.
 
Status
Not open for further replies.
Top