• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Creating a Randomized TD Wave-Set System

Status
Not open for further replies.
Level 3
Joined
Mar 14, 2022
Messages
17
Hello! I am creating a TD with a few complex ideas I'm trying to implement... but have next to no idea how. I am reasonably new to using the Editor, but am trying to my best to learn while making my dream TD.

I want to make it so there are multiple Wave Sets of units which get rolled after each the previous Wave Set has been completed. There will be 6 wave set types, each with units from a Specific Race. The reason for this is that at the end of a wave set - there will be a boss, and when the player kills the boss, they receive an item which will allow them to unlock another type of builder with different towers. The builder that they can unlock depends on the wave set they've completed, as to make it randomized and feel earnt.

For example - a player completes the Human wave set they rolled, so at the end get an item allowing them to unlock the Human Builder. The item dropping part I can figure out myself... But the randomized wave system seems pretty difficult. Its also important to note that all 6 wave sets wont be played through each game - only 4 out of the 6 will be chosen for both replay-ability and so each game can be different.

Each player starts with a "Basic Builder", and then once they complete their first wave set - can unlock a specialization with the item they receive from killing the boss. After this; they cannot go back to the basic Builder - he's only there to get started.

I know this sounds a little complicated, so just as an example:

Wave 1 - 10 - Random Wave Set (Human/Orc/Night Elf/Undead/Lich/or Demon)
Wave 11 - 20 - Random Wave Set (Human/Orc/Night Elf/Undead/Lich/or Demon)
Wave 21 - 30 - Random Wave Set (Human/Orc/Night Elf/Undead/Lich/or Demon)
Wave 31 - 40 - Random Wave Set (Human/Orc/Night Elf/Undead/Lich/or Demon)
Wave 41 - 50 - End Game Wave Set (Same every game)

I also want to make it so once a player has complete a wave set; that type can't get rolled again. This is to avoid having a player possibly play through 4 of the same race type and essentially only be able to unlock 1 builder - They need to be able to unlock a new builder at the end of each wave set.

I was going to create wave sets for each Race at each wave level... So, for example, have 4 types of Human Wave Sets (Wave 1 - 10, 11 - 20, etc) which have the same unity type, but with adjusted stats to suit that wave level. I was considering doing this by using a multiplier on the stats so I would only have to make 1 of each wave set... But I also want to adjust the abilities depending on which wave integer the wave set has been rolled on. This gives me greater control over each waves individual stats and abilities.

Any help making this happen would be greatly appreciated!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
Some questions:

Do you want each player to have their own random set of waves? Or do they share from the same pool of random waves?

Do players start their own waves at different times or do waves start at the same time for each player? In some TDs your next wave starts when you clear your own previous wave, allowing players to progress faster than others.

Do waves of units spawn in a constant stream or do they all spawn at once?

I know I edited your map before but I'm not sure if you're going for something different now.
 
Last edited:
Level 3
Joined
Mar 14, 2022
Messages
17
Those are some very good questions!

Yes! I want every player to roll their own Wave Set, meaning every player could be going against a different Set of creeps (or some of them the same if they roll the same, etc). This means that different players can unlock different specializations throughout the game as opposed to everyone versing the same wave set and unlocking the exact same Builders.

For example... For waves 1 - 10; Player 1 could roll the Human wave set, whereas player 2 could roll the Orc wave set. After Wave 10 (continuing to Waves 11 - 20), they then roll for a different wave set as they completed the last - except now player 1 cannot roll for Humans again and player 2 cannot roll for Orc. The wave set though will be specific to the wave number (Humans Waves 11 - 20, Orc Waves 11 - 20). That's why I'll created 4 different difficulties of the same wave set for each 10 waves. That means 4 different units to make each Wave Set (such as Grunts [Wave 1 -10], Grunts [Wave 11 - 20], etc).

I still want all the waves to start at the same time for each player, as per normal TD's - After the previous wave has been cleared. (Maybe having a 15 - 20 second break in between to allow for more towers to be built, gate upgraded, items bought, houses built, etc).

I was hoping for the units to spawn in a consistent stream once the wave starts.

Its also important to note that I was also considering giving each player (in the real full version - there will be 6) their own Computer Creep player that owns the creeps spawning. This is mostly because Boss' belonging to another players wave set could be killed by a different player. but even if that's the case, an Item for the player the unit belonged too still needs to be given to the correct player.

As in... Lets say Player 1's computer is Player 12 (Creeps)... If player 2 kills the boss unit of Player 12 (which is Player 1's Boss), the item still needs to drop for Player 1 in their circle of power. I was going to do this by creating a trigger that says when "unit" belonging to "Player 12" is killed - spawn item in region. I don't think I can do that as easily in my head by only have 2 Creep computer spread between all players, haha!

You have been an incredible help already! Thank you so much! I'll link the map below if you need a map to try test some options on. You'll notice I've been working on other systems and updating the layout a little. I haven't touch or created many more triggers yet, just making Units and Buildings, upgrades, etc. I've also started work on giving the Builders a unique attack ability each... But I ran into a couple of problems which I'm sure I'll ask about in another thread.
 

Attachments

  • Test TD III U1.w3m
    71.9 KB · Views: 10
Level 3
Joined
Mar 14, 2022
Messages
17
On second thought… If it is possible to have it so the players wave sets are each unique per 10 wave, that would be preferred!

For example, player 1 and 2 cannot verse the human wave set at the same time, etc.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
On second thought… If it is possible to have it so the players wave sets are each unique per 10 wave, that would be preferred!

For example, player 1 and 2 cannot verse the human wave set at the same time, etc.
I'll see what I can do, I have the random Waves finished but that makes things a bit more complicated.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
Alright, it's going to be very confusing but it works.

I recommend reading up on Hashtables to get a better understanding (if you haven't already).

What it does:
  • Allows you to create as many Races as you want (Human, Orc, Undead, etc...) and easily add them to the Wave system.
  • You can then define as many Unit-Types as you want per Race but each Race must have the same total number of Unit-Types.
  • As an example I only added Human and Orc to the system and gave them 3 Unit-Types each. Their 3rd Unit-Types are Bosses (Heroes).
  • I used Arrays and Player Numbers to make the triggers work for both players without issues. I changed some of your existing variables to be Arrays.

What I left out / issues:
  • There's no unit scaling based on Wave Count but the system can be modified to make this a thing. The map should have all of the tools needed to do this yourself in some way shape or form.
  • The unique Sets for the Waves hurt my brain so I went with a rather crappy solution. I'm using a While loop that runs up to 1000x trying to get a Random choice that isn't shared between the two players. It's the type of solution that will probably NEVER have issues and I even made a failsafe for it just in case, but maybe 1 in a billion games players will notice that their Sets aren't unique. Again, I doubt it'll ever actually happen but as an aspiring programmer/game dev it hurts my soul to have to resort to such jank.
  • I may have been a little inconsistent with my naming conventions and descriptions for things.
  • It's missing the Actions for what should happen once you've finished all of the Waves. An easy addition.
  • It's missing the End Game Waves that are meant to always be the same but this should be a fairly easy addition.
Important notes:
  • You need to configure the WS Init trigger! I left comments and examples that should help you out.
  • The system will SEEM buggy if you don't configure it properly. Like I said before, I only added two demo Races with 3 Units each but the system is set up for 6 Races in total. It should actually work fine if you Set the WS_RaceTotal variable to 2 instead of 6. Just make sure to update this Variable when/if you add more Races.
 

Attachments

  • Test TD III U2.w3m
    80.3 KB · Views: 13
Last edited:
Level 2
Joined
Apr 1, 2019
Messages
156
  • Untitled Trigger 003
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set numberMax = 10
      • For each (Integer A) from 1 to numberMax, do (Actions)
        • Loop - Actions
          • Set numbers[(Integer A)] = (Integer A)
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set integer = (Random integer number between 1 and numberMax)
      • Set randNumber = numbers[integer]
      • Set numbers[integer] = numbers[numberMax]
      • Set numberMax = (numberMax - 1)

I find myself using this from time to time but it gives you a random number that will not repeat, pretty useful.

This is just from an old post.
 
Level 3
Joined
Mar 14, 2022
Messages
17
Alright, it's going to be very confusing but it works.

I recommend reading up on Hashtables to get a better understanding (if you haven't already).

What it does:
  • Allows you to create as many Races as you want (Human, Orc, Undead, etc...) and easily add them to the Wave system.
  • You can then define as many Unit-Types as you want per Race but each Race must have the same total number of Unit-Types.
  • As an example I only added Human and Orc to the system and gave them 3 Unit-Types each. Their 3rd Unit-Types are Bosses (Heroes).
  • I used Arrays and Player Numbers to make the triggers work for both players without issues. I changed some of your existing variables to be Arrays.

What I left out / issues:
  • There's no unit scaling based on Wave Count but the system can be modified to make this a thing. The map should have all of the tools needed to do this yourself in some way shape or form.
  • The unique Sets for the Waves hurt my brain so I went with a rather crappy solution. I'm using a While loop that runs up to 1000x trying to get a Random choice that isn't shared between the two players. It's the type of solution that will probably NEVER have issues and I even made a failsafe for it just in case, but maybe 1 in a billion games players will notice that their Sets aren't unique. Again, I doubt it'll ever actually happen but as an aspiring programmer/game dev it hurts my soul to have to resort to such jank.
  • I may have been a little inconsistent with my naming conventions and descriptions for things.
  • It's missing the Actions for what should happen once you've finished all of the Waves. An easy addition.
  • It's missing the End Game Waves that are meant to always be the same but this should be a fairly easy addition.
Important notes:
  • You need to configure the WS Init trigger! I left comments and examples that should help you out.
  • The system will SEEM buggy if you don't configure it properly. Like I said before, I only added two demo Races with 3 Units each but the system is set up for 6 Races in total. It should actually work fine if you Set the WS_RaceTotal variable to 2 instead of 6. Just make sure to update this Variable when/if you add more Races.
Heya Uncle!

I'm sorry for taking so long to reply to you! I really appreciate how quickly you responded, as it helped me know what I've needed to do next.

I've taken a look at your system, however havent played around with it yet as I realized that I had no custom units to put into the system yet! So, I've been spending all my time recently creating the custom units for the TD. There will be a total of 250 custom units in this map... So its taking me a while to put them together with custom models and skins and the like!

I'm still working on the units, but once everything's done, I'll have a play around myself and see what I can make happen!

You have already been such an huge help, and your system I am sure is very well put together! I'm excited to continue making this map a reality and I couldn't do it without your help, so thank you again!
 
Status
Not open for further replies.
Top