I need an enemies spawning algorithm for a 2D tower defense game. I have 4 maps, each has 4 stages and each stage has 40 rounds. I need to create an algorithm which will instantiate waves, increase health and change their type in new rounds, new stages and in new maps. I need your suggestions and ideas to resolve my problem.
Lets take an example which is somewhat in my mind:
MAP1- Stage-1, on Rounds 1,2,3,4 loop around with '+5' on it so also in Rounds 6,7,8,9 ...so on... instantiate 'Type-1 swarm' after increment(+5) add 'Type-1 swarm + some value' so that if previous 'Type-1 swarm' (on rounds 1,2,3,4) has 3 enemies, after above increment(+5) 'Type-1 swarm' has 3+some value. The rounds multiple of 5 will instantiate 'Type-2 swarm + some value', and as round increases health value should also increase.
On Map-1 Stage2/ and other Maps and stages repeat the above process with some slight difficulty and change type swarm1 and swarn2 with other swarn types.
I hope you people got what I actually need. I don't want to hardcode the rounds because there is also an endless option in my game and hard level would have 100 rounds instead of 40.
Any other spawning ideas/algorithms followed by TD game programmers/designers.