Spawner to Spawn Enemy Exponentially

Homebrew_KidHomebrew_Kid Member Posts: 21
edited March 2014 in Working with GS (PC)

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

  • natedawgghnatedawggh Member, PRO Posts: 34

    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.

  • Homebrew_KidHomebrew_Kid Member Posts: 21
    edited March 2014

    @natedawggh said:
    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.

    Thank you! Division can take the portion of the time, although getting larger, and make it an enemy per x seconds.

    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.

    Oh, I didn't know about the internal clock.

  • Homebrew_KidHomebrew_Kid Member Posts: 21

    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.

  • Homebrew_KidHomebrew_Kid Member Posts: 21
    edited March 2014

    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

Sign In or Register to comment.