AS2 Best practices for increasing difficulty over time?

Subscribe to AS2 Best practices for increasing difficulty over time? 6 posts

Sign in to reply


 
avatar for MCOBigBen MCOBigBen 256 posts
Flag Post

I’m working on my Shootorial clone, and want to increase difficulty over time. Since the difficult is mainly managed by the timer that releases new ships, I thought I’d just have it reduce the timer by 1 every time it released a new enemy. I didn’t realize that this was a geometric progression until the infinitely thick wave of enemies brought my computer to its knees…

So now I’m kicking around other ideas:

I have a series of timers now that slowly bring the spawn timer down by 1.

I could reduce the spawn timer by a percentage of itself.

Or, I could create an array of different length spawn timers and just call the next one each time I want to increase the difficulty.

Is there a preferred way to handle this?

 
avatar for Jabor Jabor 11382 posts
Flag Post

How I would handle it:

Have some variable that is constantly being incremented by somenumber.

When it reaches targetnumber, spawn an enemy.

You can linearly increase somenumber as time goes by for an increase in difficulty that doesn’t get too excessive.

 
avatar for MCOBigBen MCOBigBen 256 posts
Flag Post

Thanks!

I’m also looking for a system that can be relatively easily compressed for testing. In your system, if you wanted to accelerate it for testing, would you decrease targetnumber?

What I have currently is:

enemyTimer: just counts up all the time, and resets when an enemy is spawned
enemyTimerGoal: the goal for enemytimer to reach, so spawning an enemy happens any time enemytimer > enemyTimerGoal
enemyTimerGoalAdvance: a second timer that counts up to a static goal and then resets. Whenever it reaches its goal, it multiplies enemyTimerGoal by 0.9

The result I seem to be getting is a curve that starts out relatively steep, and then flattens (which is what I was hoping for). I can also compress/accelerate the advancement by reducing the target that enemyTimerGoalAdvance is marching towards. On the flatter part of the curve I’m going to increase difficulty by adding new enemy types.

 
avatar for Draco18s Draco18s 5885 posts
Flag Post

Include a cut-off value, such that the enemy timer never falls below a certain value, and when it does you start giving your enemies more health, have them move faster, shoot more, etc.

 
avatar for MCOBigBen MCOBigBen 256 posts
Flag Post
Originally posted by Draco18s:

Include a cut-off value, such that the enemy timer never falls below a certain value, and when it does you start giving your enemies more health, have them move faster, shoot more, etc.

Thanks, that’s a good idea.

 
avatar for MaToMaStEr MaToMaStEr 628 posts
Flag Post

Well i think you could add a combination of 2 things to make it harder.
1. Give more HP to the enemies.
2. Spawn enemies faster.

Now, to levelUp the game you also have to options
1. To level UP after some time, in wich case you can use a Timer that calls the function levelUp() but only until certain level has been reached
2. After a certain number of enemies of the current level have been spawned. In this case you want to have a variable that increment every time you spawn an enemy. When it reaches a certaim maximum you call the levelUp() function.

About the levelUp function…
You could do something like…. increment the HP of the enemies. When the HP has been incremented, lets say… 3 times.. make the spawn timer run a bit more faster.

Like Draco said,,,, there are a number of variables that can help you make your game harder and harder. Play with these…
I don’t know… just some ideas

Sign in to reply