Increasing difficulty algorithm

Started by
12 comments, last by LorenzoGatti 5 years, 11 months ago

I'm working on an endless wave-based arkanoid/space invaders style hybrid. Bricks spawn above the screen and move down line by line. You must destroy all bricks before they hit the bottom of the screen. There will be multiple types of bricks and random power-up spawns. Currently I am just using a simple Log function that takes in the current wave as a parameter. This works to increase the number of bricks spawned each wave, but I want to find a way to make this much more complicated. Here is a list of everything that should be effected by the increase in difficulty:

1. Number of bricks

2. Types of bricks (1 hit bricks, 2 hit bricks, 3 hit bricks, etc.) 

3. Speed that the bricks move down the screen

4. How often power-ups spawn

The biggest problem here is that I can't just increase all of these with each new wave. If I did that, it would quickly become far to difficult. What I would like is an algorithm that gives some amount of variance in the increase between all 4 of these. Say one wave we put 60% of the increase to number of bricks, 20% increase to power-up spawns, 10% to types of bricks and 10% to speed of bricks. But on the next wave those percentages are all moved around and we now have say 105% to work with so the overall difficulty has increased as well. The different types of bricks need to also change to the point where if someone has made it to a certain wave, such as wave 50 for example, there are no longer any 1 hit bricks. We now would have just 2-4 hit bricks, and if they are crazy good and make it all the way to round 100, Now it's just 3-5 hit bricks, etc. 

If anybody has any good ideas or suggestions on this, I'd appreciate anything you've got! Thanks!

Advertisement

Maybe logic would be better here than math. For example Left4Dead used "The Director" and logic based AI. Even today Left4Dead is still one of the most played multiplayer games and a lot of it is because of the AI. 

2 minutes ago, Scouting Ninja said:

Maybe logic would be better here than math. For example Left4Dead used "The Director" and logic based AI. Even today Left4Dead is still one of the most played multiplayer games and a lot of it is because of the AI. 

I have never heard of this before, so I just looked up some information on it. Is this something that would be feasible for a mobile game though? It sounds super complex.

It is complex but light on resources, remember that Left4Dead was made for computers much slower than modern mobiles. Like all AI the key is turning the behavior into math and doing it as cost effectively as you are willing to compensate for. 

Just think of how you want the AI to behave when a player does something and turn that to math. Then use lighter equivalent math to get roughly the behavior you wanted with low battery cost.

Sounds cool. I'll do some more research into this type of thing and see what I can come up with. I'm actually not working on this part of it yet, but wanted to start getting some ideas of what to do when I get to it because I'm a bit worried it's going to be pretty difficult. I'm excited to see what I can come up with for it though. Thanks again for the help ScoutingNinja!

I think you should probably make the selection of those parameters part of the level design. Have a human decide how to set all those variables in each level. You can even have thematic sections, perhaps indicated by the background and/or the music, where perhaps all the bricks have more hit points. In other sections perhaps they move faster...

Just make sure that you have easy tools to tweak the experience of playing the game.

5 hours ago, alvaro said:

I think you should probably make the selection of those parameters part of the level design. Have a human decide how to set all those variables in each level. 

This is an endless game though. If I give it a set a certain amount of levels it breaks the concept of almost all the other game mechanics in the game that I have designed to get people to keep playing for more than just a few days.

1 hour ago, ethancodes said:

This is an endless game though. If I give it a set a certain amount of levels it breaks the concept of almost all the other game mechanics in the game that I have designed to get people to keep playing for more than just a few days.

I think it's not bad to ramp up the parameters you have set, but you should do it more slowly, and try to match a ideal play session for your game.

For example, if you want the average play session to be 10 minutes, or 25 enemy waves, you adjust the progression so when the playtime reaches 10 minutes, the game is hard: enemies are really fast and tough, and powerups are scarce. Sure, some gamers will find the game difficult before this point, and some will reach easily 20 minutes or 100 wave (insanelly difficult, in theory). But you should aim for the average players, the ones in the mark 8~12 minutes or 50 waves, depending of your play session criteria.

19 hours ago, ethancodes said:

The biggest problem here is that I can't just increase all of these with each new wave.

Then don't do that. Change parameters at different paces. Your parameters are dependent of each other, so you can't have a single function for all of them.

For some, like number of enemies, you probably can increase 5% or less at each wave.

Others, like powerup scarcity, would be almost the same in each wave: the increase in enemy numbers automatically makes then scarcer, because each wave takes more time. An increase in powerup total by 2% at each wave can be enough.

Enemy toughness and speed also depend of the number of enemies: in some waves, instead of adding many more enemies, you recreate a previous wave and make some enemies tougher or faster. So, instead of adding 5 enemies, you add 2 tougher ones. This also let the player know the differences between them.

So, instead of a function that changes all the parameters at each wave, you can have one that, based on the previous change, calculates the next one. If the previous wave added 5 enemies (from 15 to 20), the next one can also have 20, but 3 of them are stronger than before, or all of them are 5% faster. It may seem like a small increase, but remember to aim for the average play session you want the players to have, not to the current one only.

Also, add some randomness to the function, so each play session is not the same, which can make the game boring. You can run the math in Excel, and create a graph of the progression, to have an idea of how it would work, before implementing on the game.

Right I understand all this, my problem is I have 0 idea of how to actually implement it. I have very little experience with coming up with math equations to solve problems like this. I have started to break it down a little bit and come up with a few ideas, but I have no idea how well it's actually going to work when I start trying to implement it. I have a feeling this is just going to be massive amounts of trial and error.

32 minutes ago, ethancodes said:

I have a feeling this is just going to be massive amounts of trial and error.

Yes, game balancing involves that. But you're not completely in the dark.

Based on my idea of ideal play session (after X minutes or Y waves), first you can try to define what would be the scenario when reaching these milestones (X and Y) when playing. How hard will the game be when the player gets there?

Say you start with scenario Z:

  • 10 enemies with toughness of 1 (1 hit kills);
  • enemy speed of 1.0;
  • powerup spawning of 1 in 10;

And your target (when in X or Y) is scenario W:

  • 30 enemies with toughness of 3 and 10 with toughness of 4;
  • enemy speed of 5.0;
  • powerup spawning of 1 in 30;

So you would try to create a function that, given X or Y, outputs W for a start point Z, with more or less 10% variation. But the in-between results probably will not be linear, and some waves will be a little more hard than others. For example, you can "toughen up" 10% of the current enemies after 5 waves.

The function output the parameters for any wave, but its optimal scenario is between Z and W. Waves bellow Z of after W may not be scaled well, but that's not a big problem, because you have reached your ideal play session.

Those are general ideas. You may want to take a look at https://www.gamasutra.com/blogs/KristerKarlsson/20161108/285010/Balancing_the_sh_out_of_our_shmup.php , for more ideas.

This topic is closed to new replies.

Advertisement