Pro tip: Weapon balancing

A place for people with an interest in developing new shmups.
Post Reply
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Pro tip: Weapon balancing

Post by n0rtygames »

It's pissed me off a few times when I try to make cool weapons and then things start to get strange. See, the thing with shmups is you want satisfying weapons. This is probably the most important thing in a shmup. Things that really feel like they're going BOOM. But they can be hard to balance without visualisation.

It's okay to have a ship that is more powerful than another - you can offset this with reduced speed. A ship that has a wider spread is traditionally slower, but what about the ship that fires a narrow stream of hard hitting missiles?

Enter this little fellow:
Image

Sort of dawned on me while going to sleep last night that a simple way to check the DPS of ships would be to actually measure their damned DPS. Which is damage per second. So, what does he do?

Special enemy that I lay down on his own to sit in the middle of the screen. He ignores damage, takes no health reduction and reports any damage taken back to another object in the game.

Yus.

Code: Select all

edit: Except my maths was screwed here and I was being dumb.

What you want is to:

* Add 0 to the list for each frame the object isnt taking damage
* Add damage taken when it gets hit
* Add up all your values
* Divide by total

Just attack til the value sort of levels out. Also have a reset button
Image

It's okay to use floats here. You're not after precision - just a quick sanity check for "Is this actually OP, or does it just FEEL overpowered?"

If something FEELS overpowered but is in fact balanced when it comes to the numbers - congrats, you've nailed it.
Last edited by n0rtygames on Mon May 26, 2014 9:25 am, edited 1 time in total.
facebook: Facebook
User avatar
Pteriforever
Posts: 250
Joined: Mon Dec 17, 2012 10:53 pm

Re: Pro tip: Weapon balancing

Post by Pteriforever »

I did something very similar with Starhall 1 ^.^ Served me well, I managed to decently balance a ton of shot types.

Highly recommend.
Starhall || Abmneshi || Starhall 2
RegalSin wrote:The art in my opinion is quesitonable, because it looks like it relies on computer art
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Re: Pro tip: Weapon balancing

Post by n0rtygames »

Yus.

Except my maths was screwed here and I was being dumb.

What you want is to:

* Add 0 to the list for each frame the object isnt taking damage
* Add damage taken when it gets hit
* Add up all your values
* Divide by total

Just attack til the value sort of levels out. Also have a reset button
facebook: Facebook
User avatar
DJ Incompetent
Posts: 2374
Joined: Tue Jun 13, 2006 10:28 pm
Location: Murda Mitten, USA

Re: Pro tip: Weapon balancing

Post by DJ Incompetent »

I was trying to make a similar thing, but didn't get it working the way I wanted.
Thanks for sharing. I will study your notes.
User avatar
laxa88
Posts: 51
Joined: Mon Mar 10, 2014 10:32 am

Re: Pro tip: Weapon balancing

Post by laxa88 »

Just wanted to say thanks for the share! It's a very helpful technique which I'll adopt for my player's weapons later.
Doodle/development tumblr : http://wyleong.tumblr.com
Art (rarely updated) : http://animenifestor.deviantart.com
User avatar
BPzeBanshee
Posts: 4859
Joined: Sun Feb 08, 2009 3:59 am

Re: Pro tip: Weapon balancing

Post by BPzeBanshee »

I'll see about getting an example GM project that does this after the weekend. Shouldn't be too difficult to do so long as I dont butcher my maths.
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Re: Pro tip: Weapon balancing

Post by n0rtygames »

I've actually been playing with GMOSSE myself a bit lately for no real reason. It's pretty well laid out btw. Should be quite trivial to implement this. :)
facebook: Facebook
User avatar
BPzeBanshee
Posts: 4859
Joined: Sun Feb 08, 2009 3:59 am

Re: Pro tip: Weapon balancing

Post by BPzeBanshee »

http://www.mediafire.com/download/fsqsr ... DPSTest.7z

Pretty basic example project of a DPS tester. Your math seems overly complicated to just find out how much damage it's doing to the enemy per second, I think you're trying to get average DPS rather than raw? I just stored its initial HP value and checked the difference between that and it's current HP value (resetting HP value to said init value) every 60 steps - No lists or division stuff. Not hard to implement either way, and this object now exists in GMOSSE too.
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Re: Pro tip: Weapon balancing

Post by n0rtygames »

BPzeBanshee wrote:http://www.mediafire.com/download/fsqsr ... DPSTest.7z

Pretty basic example project of a DPS tester. Your math seems overly complicated to just find out how much damage it's doing to the enemy per second, I think you're trying to get average DPS rather than raw? I just stored its initial HP value and checked the difference between that and it's current HP value (resetting HP value to said init value) every 60 steps - No lists or division stuff. Not hard to implement either way, and this object now exists in GMOSSE too.
The maths isn't even slightly complicated. The approach I have suggested will take in to account frames where no damage is applied - which accounts for speed of bullets, rate of fire, number of bullets hitting the enemy. This is why I said for each frame the enemy is not taking damage - you add a zero.

While your approach is certainly valid, if you want to start seeing exactly what the problem is if one of your weapons is particularly overpowered - with a sample to work from you could actually go 200% nerdier and start plotting graphs etc if you use lists ;)
facebook: Facebook
Cagar
Posts: 2234
Joined: Fri Nov 25, 2011 5:30 pm

-

Post by Cagar »

-
Last edited by Cagar on Wed Dec 20, 2023 5:01 pm, edited 2 times in total.
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Re: Pro tip: Weapon balancing

Post by n0rtygames »

^ This is some hilarious shit.

Cagar I love you sometimes
facebook: Facebook
User avatar
BPzeBanshee
Posts: 4859
Joined: Sun Feb 08, 2009 3:59 am

Re: Pro tip: Weapon balancing

Post by BPzeBanshee »

:lol:

I went back and did it your way n0rty to get an average DPS rather than raw but I must've screwed up somewhere since the thing just keeps gradually incrementing upwards. I was at 1.65 before I got bored and went back to oh hey new Game of Thrones is out i'd better watch that~
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Re: Pro tip: Weapon balancing

Post by n0rtygames »

Probably because you're still dividing by 60 instead of the actual sample size.

Work with two examples, let's visualise them. In example 1, every frame hits - in example 2 - every second frame hits. This means that example 2 should be 50% of example 1. We'll do it with a sample size of 20. Each array element represents the damage done that frame.

[9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9] = 180
[0][9][0][9][0][9][0][9][0][9][0][9][0][9][0][9][0][9][0][9] = 90

180 / 20 = 9
90 / 20 = 4.5

If we double the length of the examples
[9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9]
[9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9][9] = 360

[0][9][0][9][0][9][0][9][0][9][0][9][0][9][0][9][0][9][0][9]
[0][9][0][9][0][9][0][9][0][9][0][9][0][9][0][9][0][9][0][9] = 180

360 / 40 = 9
180 / 40 = 4.5

If you are dividing by 60, what's happening is that your sample size is constantly growing and thus the number will of course always creep up because you're just dividing by a fixed value. This is not how you calculate an average though. As I said, for this you need a reset button that you push to start sampling and then after about 5-10 seconds (at most) of sustained fire, the value should be stable.

My first example in this thread was dumb. The second example I gave is the one you want. I shall edit out the first example to avoid confusion :P
facebook: Facebook
User avatar
BPzeBanshee
Posts: 4859
Joined: Sun Feb 08, 2009 3:59 am

Re: Pro tip: Weapon balancing

Post by BPzeBanshee »

Oh, n0rty darling, I'm pretty sure I know how to do averages rather than just div by 60. :P

You're welcome to look at the new source if you like. I currently suspect I'm missing something else, perhaps in GM's order of events. I sit there hitting it and it gradually goes up decimally regardless.
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Re: Pro tip: Weapon balancing

Post by n0rtygames »

Do you have complete control over the order of events (in your games logic updates at least) in gamemaker?

hnngggghhh why do you have gameplay logic in your draw? This is not the place to be setting your counters :<
facebook: Facebook
mystran
Posts: 77
Joined: Tue Mar 12, 2013 11:59 pm
Location: Helsinki, FI

Re: Pro tip: Weapon balancing

Post by mystran »

Random (untested) idea: make an hitbox-less enemy (otherwise like the test box) that shoots smaller (eg popcorn sized or whatever you want to test for) boxes around (or just have a swarm follow some spinning route like electrons around an atom, whatever), count combined damage done to all the boxes -> should give estimate average DPS (from different distances if repeated) for "wide shot" or similar types where not all the bullets are likely to actually hit (so estimating actual DPS analytically is very tricky).

No idea how practically useful this is (plus I guess it's pretty obvious extension), but thought I'd share anyway.
teronjonnz
Posts: 1
Joined: Mon May 26, 2014 3:16 pm
Location: 123 street

Re: Pro tip: Weapon balancing

Post by teronjonnz »

Not enough speed, aggresion and overwhelming wall of death type
encounters...Games like Zaxxon, Star Wars arcade or Gyrus
pushed what was being done with a shooting type games. Some
people appalauded it some people thoguh they were unplayable...
User avatar
trap15
Posts: 7835
Joined: Mon Aug 31, 2009 4:13 am
Location: 東京都杉並区
Contact:

Re: Pro tip: Weapon balancing

Post by trap15 »

What
@trap0xf | daifukkat.su/blog | scores | FIRE LANCER
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
User avatar
emphatic
Posts: 7984
Joined: Mon Aug 18, 2008 3:47 pm
Location: Alingsås, Sweden
Contact:

Re: Pro tip: Weapon balancing

Post by emphatic »

trap15 wrote:What
teronjonnz wrote:some people thoguh
^^this, of course.
Image | My games - http://www.emphatic.se
RegalSin wrote:Street Fighters. We need to aviod them when we activate time accellerator.
User avatar
BPzeBanshee
Posts: 4859
Joined: Sun Feb 08, 2009 3:59 am

Re: Pro tip: Weapon balancing

Post by BPzeBanshee »

n0rtygames wrote:Do you have complete control over the order of events (in your games logic updates at least) in gamemaker?

hnngggghhh why do you have gameplay logic in your draw? This is not the place to be setting your counters :<
Of course normally I'd never do anything so badly coded. I shoved it all in Draw because that's literally the last event before the screen gets updated and I was hoping that doing it all at once would fix it, turns out it did not.

In terms of changing the order of events, no. For example I can't just do Create events after Step, that much is hardcoded in, but I can change which point of the Step (ie frame) I can use by picking Begin Step, Step or End Step. Didn't seem to make a difference when I tried so I suspect I may have to do collision handling manually.
User avatar
Formless God
Posts: 671
Joined: Fri Mar 12, 2010 7:46 am

Re: Pro tip: Weapon balancing

Post by Formless God »

trap15 wrote:What
oh shit it's RegalSin
RegalSin wrote:Then again sex is no diffrent then sticking a stick down some hole to make a female womenly or girl scream or make noise.
mystran
Posts: 77
Joined: Tue Mar 12, 2013 11:59 pm
Location: Helsinki, FI

Re: Pro tip: Weapon balancing

Post by mystran »

BPzeBanshee wrote:
n0rtygames wrote:Do you have complete control over the order of events (in your games logic updates at least) in gamemaker?

hnngggghhh why do you have gameplay logic in your draw? This is not the place to be setting your counters :<
Of course normally I'd never do anything so badly coded.
Famous last words. :twisted:
Post Reply