Spawner to Spawn Enemy Exponentially
Homebrew_Kid
Member Posts: 21
Hey all, trying to create a spawner that spawns an actor based on a game.time^(0.x) = spawn type equation. The goal is to make the game progressively harder by spawning more and more throughout the course of 10-30 minutes.
For example:
every game.time = 5 sec
spawn rate: 1 per 5 seconds
every game.time = 10 sec
spawn rate: 1.5 per 5 sec
game.time is defined as follows:
Just some arbitrary equations to help you get the picture:
every game.time spawn 0.2 // It seems with every millisecond it spawns no matter the argument.
every game.time^(0.0001) spawn actor // Slower, but no change in frequency.
Comments
Probably something like "every 10-(game.time/10) seconds..."
That way you start at 10 (or some high number interval) and then subtract a fraction of the passing time from 10 (or whatever your starting interval is.
Also, I noticed on your code... you can't change game.time... it's a set number that runs continuously as the game runs. You can reference it, however, and you can also set your own real attribute and feed game.time to it to use and manipulate as you want.
Thank you! Division can take the portion of the time, although getting larger, and make it an enemy per x seconds.
Oh, I didn't know about the internal clock.
I have this so far but it is only spawning enemies after 10 seconds. If the calculation is correct, after 60 seconds, there should be four that spawn.
10-(60/10)
I am using the internal game.time that is pre-programmed into the game.
I think it should be more along the lines of this graph:
if 10-(game.time/10) is the original equation, then after 100 seconds:
10-(100/10) = 10-10 = 0