I’ve been having trouble thinking of a simplistic way of creating a zombie ‘wave-system’.
Here is what I am trying to build:
A wave system (typically seen in zombie games). As the waves increase, zombies will increase in amount and strength (different zombie ‘types’ are spawned in on higher waves) Each round increases when the timer hits 00:00 OR if all zombies are killed. I’m trying to implement randomness, not a fixed set of zombies that will spawn each round.
I’m trying to stay away from making the rounds bleak and repetitive.
I haven’t seen any posts directly addressing a zombie ‘wave-system’, hence is the reason why I created this post. Let me know if there is a resource already available. Thank you!
I’m unaware of any resources which directly address a system which you seem to be looking for. However, I would argue that the system you seek is highly subjective and may be that way because of the specific use case you intend to implement it for. Although I’m unsure of the exact details, I would guess that “classic” wave systems are highly structure, meaning it is either explicitly defined or some sort of increasing function is used to determine “difficulty”. Before you look too much further into ways to introduce “randomness” into waves, I would stop to suggest you ask yourself how much randomness could impact the player’s ability to navigate a wave system. Different variables you introduce to produce a “random” effect can have various effects on the “difficulty” of each wave. For example, if the number of spawned zombies is varied, this will obviously increase the difficulty for the waves which happen to have more. However, variables such as spawn location would have a much smaller impact on the overall sense of “difficulty” while still avoiding the repetitive nature of waves. For that reason, I would take a moment to consider all variables which can change across waves (examples: number of zombies, type zombie, health per zombie, spawn location, speed, damage dealt to players, spawn frequency/how fast the zombie spawn, etc.) and group them into categories based on whether each variable will have a direct impact on “difficulty”, as perceived by the player(s), or the change will (at least mostly) only counter act this sense of “sameness” you seem to be running from. I would argue, however, than any “randomness” introduced into a wave system will always inevitably lead to some difference in “difficulty” per wave, which, depending on your context, may negatively impact a player’s experience. If too much “randomness” is introduced into each wave, and therefore the perceived difficulty shifted too much from one play through to another, there will be no benefit to the player to learn how to overcome each wave. I realize this may be your intent and you may want player’s to always feel as if they need to improvise in order to survive, however one of the most satisfying aspects of game, both consciously and unconsciously, is the ability to “game”/learn the system and therefore overcome it.
I find this question very intriguing, please keep us all updated on how you experiment with, and ultimately decide to implement this feature.
For the wave system, I would use a while true do loop to control how often the enemies spawn. Then I would make a for loop inside that for the timer. You could create a variable for the number of zombies and break the for loop after the number of zombies reaches 0.
For the randomness, I would create a table with all the different zombies that I had stored in replicated storage. I would loop through the table and spawn a random number of each zombies based upon what wave they are on. So it might be limited to 1-3 of each zombies for the first 5 waves and then go up to 2-4 of each zombie for the next 5 waves and progressively get harder as you go.
not tested, just an example to get you started:
local rs = game:GetService("ReplicatedStorage") -- path to zombies
local blue = rs.Blue --blue zombies
local red = rs.Red -- red zombies etc.
local zombies = {blue, red}
local zombiecount = game.Workspace.Zombies -- int value to track number of zombies, this can be deducted when the zombie is killed
while true do
-- spawn your zombies
for i = 30, 0, -1 do --rounds would be 30 seconds
if zombiecount.Value == 0 then --start new wave early if 0 zombies left
break
end
wait(1)
end
end
you will have to write the function for spawning the zombies and I would add a counter in there too so you know how many waves have elapsed since the start of the game. Hope this gets you started. Again, I would use the wave count variable as a multiplier when deciding how many of each type of zombies to spawn
Use fuctions, and clone zombie from (example) replicated Storage. If you want to get “zombies: 30” get a local of the zombies to add and monitor if they died