How to handle enemy waves?

Discuss game development design and post your game ideas

Post » Tue Dec 03, 2013 5:36 am

Hi,

I'm designing arcade style game, but I've got stuck on couple of things: 1. Deepening on the level what would be the best way ( mathematically ) to handle enemy spawn frequency? 2. Have no idea how to make percentage of enemy type spawning?

Any ideas?

Thanks! :)
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
91
S
30
G
22
Posts: 1,985
Reputation: 20,149

Post » Tue Dec 03, 2013 7:44 am

You could use 5/level if you want level 1 to spawn an enemy every 5 seconds. At level 10 it would be every 0.5 seconds and at 20 it would be every 0.25 second. This works well if you want infinite levels where ultimately an enemy will spawn every frame. You could also tweak the formula further to be [code]start_rate/level^factor[/code] Where factor could be 0.5 for a slower increase of the spawn rate or 2 for a faster increase.

Another approach you can use if you have a max level is to use lerp. It would look like this:
[code]lerp(start_rate, end_rate, (level-1)/(num_levels-1))[/code]
So for example if you had 50 levels and you wanted the spawn rate to be 5 seconds on the level 1 and every tick on level 50 your forula would be lerp(5,0,(level-1)/49).

In general you may be able to use some kind of easing functions to do it too.

Edit:
For the second question you could utilize something like this:
http://www.scirra.com/forum/weighted-probabilities_topic48421.htmlR0J0hound2013-12-03 09:22:35
B
94
S
33
G
113
Posts: 5,353
Reputation: 73,267

Post » Tue Dec 03, 2013 5:49 pm

@R0J0hound Thanks a lot man! Will look in to it.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
91
S
30
G
22
Posts: 1,985
Reputation: 20,149


Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 0 guests