lots of ways to do this of course but if you want to link spawn rate to time
assuming you want the spawn to be at the same moment (that is spawn 20 in 1 frame)
then you can do
every minute spawn x where x equals
spawnrate = Time/60 (time is a built in object, it returns the time in seconds since game start)
if(Time/60 == 0)
for(int x = 0; x < spawnrate; x++)
spawn();
if you’d like you can just spawn 1 every x seconds but give the rate a curve so you spawn more often but you spawn only 1 each time something like
SpawnRate = 60; // we'll start out spawning once a minute
if (Time/SpawnRateInSeconds == 0)
spawn();
now you write a script to reduce spawnrate by so much every so long
that’d look something like
if(Time/60 == 0) // every minute were going to modify spawn rate
SpawnRate -= 5;
so in this case we’ll spawn 1 the first minute and by minute 6 we’ll be spawning 2 every minute.
The main issue with this method is it’s going to get basically impossible because the growth is goign to ramp hard
that is to say when the spawnrate is 60 seconds taking 5 seconds off wont matter much.
but later on when its 10 seconds
taking 5 seconds off will basically double the spawn rate making it ramp up hugely. Your basically looking at exponential growth here. you’ll want to make sure also that you down let spawn rate drop below 0 (or you’ll have bizzare behavior). I put that in in case you acutally wanted this kind of large exponential curve.
You could have a non curved growth as well you could do that by using division by the rate
soemthing like
if(Time/60) //again we'll assum we want to change once a minute
spawnrateinseconds = spawnrateinseconds/4
or generaly
.... = spawnrate/x
where x is the rate
so if its 4 we’ll make it so every minute it spawns 25% faster/ but it’ll be a constant slope where as we get to lower spawn times we’ll also take less off the timer meaning you wont get these large spikes at the end.
MARK AS ANSWERED