Author Topic: Need some math. Mathematical idea for balancing weapons.  (Read 2320 times)

0 Members and 5 Guests are viewing this topic.

Offline Zisa

  • Count
  • *****
  • Renown: 272
  • Infamy: 124
  • cRPG Player
    • View Profile
  • Faction: I am not at liberty to say.
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #15 on: November 09, 2011, 04:18:39 am »
0
Thanks for replying, but I don't understand.  :?

Could you perhaps elaborate, do you have any suggestion for a GENERAL THEORY OF WEAPON BEHAVIOUR that could work?
Assuming that all weapons are sticks that deal blunt or cut or just damage. For our use, wether the weapon has cut, pierce or blunt is just a matter of speciality. If we know the supposed damage potential, we could easily calculate the appropriate amount of blunt, cut or pierce damage from that.

I guess what I want, is a more accurate way of determining weapon speed and damage. I have a feeling it's a bit off in the long end of weapons. Of course, trial and error is not the worst method, but it took us a year to get where we are.. Ultimately I want to see more weapon variety actually being used in cRPG.
Next you are going to want to factor in drag coeficients and bernouli principle! Madness.
Alas nodachi
remembers glorious spring
a tin can's hatchet.
http://www.moddb.com/members/psychotropicdog

Offline cmp

  • M:BG Developer
  • Supreme Overlord
  • *******
  • Renown: 2052
  • Infamy: 569
  • cRPG Player
    • View Profile
  • IRC nick: cmp
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #16 on: November 09, 2011, 05:10:25 am »
0
Also add bullet time, but only the guy with the highest level admin on the server can use it.

FTFY

Offline Tomas_of_Miles

  • Count
  • *****
  • Renown: 263
  • Infamy: 37
  • cRPG Player
  • Inactive
    • View Profile
  • Faction: Rusty mercenary siege engineer
  • Game nicks: Something with Tomas in it
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #17 on: November 09, 2011, 05:19:31 am »
0
With stuff like impulse and pressure you'd need more detailed hitboxes. A pick has high force on the end due it's small surface area. But a hit with the shaft would be pretty useless.
Professional poop cleaner

Offline CaptainQuantum

  • Knight
  • ***
  • Renown: 44
  • Infamy: 11
  • cRPG Player
    • View Profile
  • Faction: The 22nd Battalion
  • Game nicks: Quant, Quantum
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #18 on: November 09, 2011, 09:17:13 pm »
+1
It seems I have been called, though as a prior note, I am a theoretical physics student, not a physics lecturer/teacher so if I am not clear in my explanation tell me.
Also as a secondary note I did take a mathematical view on this, I must say its bad for Warband, I calculated the highest speed rating for a glaive rotated about it's edge to be 66, which is clearly too slow. Polearms in real life are useless for slashing since they gain damage either for being longer, since their lengths make them harder to swing.

Ok rotational physics is about moment's of inertia, for a point particle rotated about a point:
I=mr^2 where r is the distance from rotational axis

For a body of many masses:
I=Sum(mr^2) where r is the distance from the rotational axis of each mass in the sum
This generalises to
I=Integral{r^2 dm} where dm is an infinitesimal mass unit (knowledge of calculus assumed here)

The stated integral in it's current form is rather useless but from it I will derive a more useful relation.
 Density p=m/V where V=volume

So I=Integral{p*r^2 dV}
This is now useful, but results in some messy 3-Dimensional integrals. However fortunately for you guys we are not going to be doing wierd stuff like I have to with this relation, so we should have some pretty easy relations.

The moment of inertia is a parametre specifying the difficulty to rotate an object about some rotational axis, and hence varies depending on your chosen axis.
The amount of energy taken rotate an object is related to moment of inertia by:
E=0.5*I(omega)^2 where omega is the angular velocity you wish to rotate this object at.

Also as Tomas stated, the are of the point of the weapon hitting you matters greatly, since pressure, P=Force/Area=F/A .
So small areas result in larger pressures. Also the duration of impact matters since:
Impulse= F(Delta t)=(Delta mv)  where delta() = the difference in maximum and highest value, for example Delta t is the duration of t.

Apologies on the format of the mathematics here, I could not seem to use any software to make integrals look prettier, I am sure most of you who understood this probably think that integrals are never pretty :)
« Last Edit: November 09, 2011, 09:24:42 pm by CaptainQuantum »

Offline Paul

  • Developer
  • ******
  • Renown: 1879
  • Infamy: 442
  • cRPG Player A Gentleman and a Scholar
  • ball bounce boss
    • View Profile
  • IRC nick: Urist
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #19 on: November 09, 2011, 09:24:36 pm »
0
Thanks, this will be useless.

Offline CaptainQuantum

  • Knight
  • ***
  • Renown: 44
  • Infamy: 11
  • cRPG Player
    • View Profile
  • Faction: The 22nd Battalion
  • Game nicks: Quant, Quantum
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #20 on: November 09, 2011, 09:25:22 pm »
0
I know, but a man asked for Physics, so the man gets Physics! I hope I have proven to you why nobody uses true physics in their balance systems, this stuff takes a long time to calculate and some incredibly well designed systems to implement.
« Last Edit: November 09, 2011, 09:30:37 pm by CaptainQuantum »

Offline Thomek

  • El Director
  • OKAM Developer
  • ***
  • Renown: 1372
  • Infamy: 481
  • cRPG Player A Gentleman and a Scholar
    • View Profile
    • Ninja Guide Wiki
  • Faction: Ninja_
  • Game nicks: Ninja_Thomek
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #21 on: November 09, 2011, 10:12:50 pm »
0
Paul: OK.

Thanks Quantum :)

I just hoped that there would perhaps be some other reasoning to use, than what we think is UP or OP at any given moment.

I suspect that such an approach would, over time, change the way we think of cRPG melee combat. Perhaps I'm far off, but I would suspect it would be a move towards more powerful, but less nimble long polearms and swords.. Shieldbash could let us make 1h weapons less powerful, like a 1-arm weapon should be.

And generally, choosing your weapon should be a very specific choice for the specific role you play on the battlefield. No more one tool does it all. Rather let people be more dependent on teamwork.
visitors can't see pics , please register or login


That Thomeck-delay-kicking bussiness is like that asshole-retard dude that fucks your sister sometimes.

Offline Zisa

  • Count
  • *****
  • Renown: 272
  • Infamy: 124
  • cRPG Player
    • View Profile
  • Faction: I am not at liberty to say.
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #22 on: November 09, 2011, 10:27:15 pm »
0
Thomek I suspect such an approach willb e cumbersome tedious and unfun.
Alas nodachi
remembers glorious spring
a tin can's hatchet.
http://www.moddb.com/members/psychotropicdog

Offline CaptainQuantum

  • Knight
  • ***
  • Renown: 44
  • Infamy: 11
  • cRPG Player
    • View Profile
  • Faction: The 22nd Battalion
  • Game nicks: Quant, Quantum
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #23 on: November 09, 2011, 10:46:30 pm »
0
Instead of a realistic approach I would suggest instead that the stat balance of weapons is determined by having some constant equal to the product of each stat. It would go something like this:
k=a*b*c*d*e...
Each stat could have a relative weighting factor and could be a reciprocal of a value if it's better to have lower values for that stat. This would be a much better balancing system in my opinion.

Offline Jarlek

  • King
  • **********
  • Renown: 1173
  • Infamy: 307
  • cRPG Player Sir White Pawn A Gentleman and a Scholar
  • The walking wiki
    • View Profile
  • Game nicks: Jarlek_The_Blue, Jarla, Jarlen, Jarler, Jarlec, Jarled OH GOD ALL THESE ALTS
  • IRC nick: Jarlek
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #24 on: November 09, 2011, 10:55:40 pm »
0
It seems I have been called, though as a prior note, I am a theoretical physics student, not a physics lecturer/teacher so if I am not clear in my explanation tell me.
Also as a secondary note I did take a mathematical view on this, I must say its bad for Warband, I calculated the highest speed rating for a glaive rotated about it's edge to be 66, which is clearly too slow. Polearms in real life are useless for slashing since they gain damage either for being longer, since their lengths make them harder to swing.

Ok rotational physics is about moment's of inertia, for a point particle rotated about a point:
I=mr^2 where r is the distance from rotational axis

For a body of many masses:
I=Sum(mr^2) where r is the distance from the rotational axis of each mass in the sum
This generalises to
I=Integral{r^2 dm} where dm is an infinitesimal mass unit (knowledge of calculus assumed here)

The stated integral in it's current form is rather useless but from it I will derive a more useful relation.
 Density p=m/V where V=volume

So I=Integral{p*r^2 dV}
This is now useful, but results in some messy 3-Dimensional integrals. However fortunately for you guys we are not going to be doing wierd stuff like I have to with this relation, so we should have some pretty easy relations.

The moment of inertia is a parametre specifying the difficulty to rotate an object about some rotational axis, and hence varies depending on your chosen axis.
The amount of energy taken rotate an object is related to moment of inertia by:
E=0.5*I(omega)^2 where omega is the angular velocity you wish to rotate this object at.

Also as Tomas stated, the are of the point of the weapon hitting you matters greatly, since pressure, P=Force/Area=F/A .
So small areas result in larger pressures. Also the duration of impact matters since:
Impulse= F(Delta t)=(Delta mv)  where delta() = the difference in maximum and highest value, for example Delta t is the duration of t.

Apologies on the format of the mathematics here, I could not seem to use any software to make integrals look prettier, I am sure most of you who understood this probably think that integrals are never pretty :)

FINALLY SOME REAL MATH!

Not that damn coding stuff!

Was a nice read. Too bad we wont balance after this. Likes the one I'm quoting after this pharagraph, though. Seems like a nice way to do it (but maybe change k with the equipment price?
Instead of a realistic approach I would suggest instead that the stat balance of weapons is determined by having some constant equal to the product of each stat. It would go something like this:
k=a*b*c*d*e...
Each stat could have a relative weighting factor and could be a reciprocal of a value if it's better to have lower values for that stat. This would be a much better balancing system in my opinion.
This game isn't about being skillful as much as its about saying things in general chat that enrage people who then go to murder you but in their rage they make dumb mistakes which gets them killed.
In memory of Jarlek_zeh_Blue, ruler of Ilvia

Offline Thomek

  • El Director
  • OKAM Developer
  • ***
  • Renown: 1372
  • Infamy: 481
  • cRPG Player A Gentleman and a Scholar
    • View Profile
    • Ninja Guide Wiki
  • Faction: Ninja_
  • Game nicks: Ninja_Thomek
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #25 on: November 09, 2011, 11:13:25 pm »
0
That's more or less what they have now quantum. (AFAIK couldnt seem to find the link, but I think fasader posted it once) The problem with that kind of formula is that it doesn't take into account how certain stats make each other better than other stats.

I.ex Length*Damage is more powerful than Speed*Damage or speed*length i.ex.

It's the fact that some combos of stats are more powerful (in battle) than other combos of stats that worries me. This is not represented well in the current formulas, so I wanted to try another approach. Perhaps going physics is too difficult and time consuming.

Anyway, someone with a good knowledge of mathematics should be able to propose a formula that is balanced, even as certain stats improve and influence each other in positive and negative ways. What I mean is that if you in example:

The a(x)*b(y)*c(z)*d(r) formula is too simplistic, because as you increase length, damage indirectly becomes more powerful, and perhaps not in a linear way. Working with a more complex one could give more accurate results.

I think this could be the very reason all the popular/most effective battle weapons are so similar. (As in moderate speed, long range, good damage)

Of course the constants in such a formula would have to be adjusted and refined over time, but it could give more accurate results.

The formula basically needs to be in a system that allows for flexibility in how the stats influence each other power levels.

What would that look like Quantum? :)

« Last Edit: November 09, 2011, 11:17:08 pm by Thomek »
visitors can't see pics , please register or login


That Thomeck-delay-kicking bussiness is like that asshole-retard dude that fucks your sister sometimes.

Offline CaptainQuantum

  • Knight
  • ***
  • Renown: 44
  • Infamy: 11
  • cRPG Player
    • View Profile
  • Faction: The 22nd Battalion
  • Game nicks: Quant, Quantum
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #26 on: November 09, 2011, 11:23:47 pm »
0
FINALLY SOME REAL MATH!

Not that damn coding stuff!

Was a nice read. Too bad we wont balance after this. Likes the one I'm quoting after this pharagraph, though. Seems like a nice way to do it (but maybe change k with the equipment price?

Unfortunately I know the coding for damage in warband too, and I also code myself :) So I guess I satisfy both desired and undesired conditions there. In all fairness some of the warband engine maths is nice, it deals with air resistance I believe. Although they do deal with speed damage bonuses in terms of energies which is incorrect since the force and duration is what damage to a human body is truly given by, since not all energy of a swing will be dissipated on a person of course.

Offline Kajia

  • Earl
  • ******
  • Renown: 481
  • Infamy: 36
  • cRPG Player
    • View Profile
  • Game nicks: Vanguard_Kajia
  • IRC nick: Kajia_
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #27 on: November 09, 2011, 11:35:15 pm »
0
I just hoped that there would perhaps be some other reasoning to use, than what we think is UP or OP at any given moment.

I suspect that such an approach would, over time, change the way we think of cRPG melee combat. Perhaps I'm far off, but I would suspect it would be a move towards more powerful, but less nimble long polearms and swords.. Shieldbash could let us make 1h weapons less powerful, like a 1-arm weapon should be.

And generally, choosing your weapon should be a very specific choice for the specific role you play on the battlefield. No more one tool does it all. Rather let people be more dependent on teamwork.
That sounds very much like the stuff I was thinking about, did you read it?
http://forum.c-rpg.net/index.php/topic,19564.0.html

I actually don't want to recycle my text there, but it fits in here, and it's not outdated, so ...

And long weapons being very slow with slashing is exactly what I was expecting, but I didn't have any numbers and relations, so thanks Quantum!
« Last Edit: November 09, 2011, 11:37:14 pm by Kajia »

Kajia's Workshop
(cRPG artwork showcase)

Offline Jarlek

  • King
  • **********
  • Renown: 1173
  • Infamy: 307
  • cRPG Player Sir White Pawn A Gentleman and a Scholar
  • The walking wiki
    • View Profile
  • Game nicks: Jarlek_The_Blue, Jarla, Jarlen, Jarler, Jarlec, Jarled OH GOD ALL THESE ALTS
  • IRC nick: Jarlek
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #28 on: November 09, 2011, 11:52:10 pm »
0
Unfortunately I know the coding for damage in warband too, and I also code myself :) So I guess I satisfy both desired and undesired conditions there. In all fairness some of the warband engine maths is nice, it deals with air resistance I believe. Although they do deal with speed damage bonuses in terms of energies which is incorrect since the force and duration is what damage to a human body is truly given by, since not all energy of a swing will be dissipated on a person of course.
Hehe, wasn't really that I was talking about. I meant the way you showed your math. Like you did this:
E=0.5*I(omega)^2
This is "normal" math and is readable for me. Just the way I like it

While chadz posts his formulas like this:
ceil((pow($troops, 1.03) * 2.5 - 100)/24)
Which is mumbo-jumbo code language that I have to look up and can't read naturally.

THAT'S what I meant with "real" math. Guess I should have specified it a bit more xD
This game isn't about being skillful as much as its about saying things in general chat that enrage people who then go to murder you but in their rage they make dumb mistakes which gets them killed.
In memory of Jarlek_zeh_Blue, ruler of Ilvia

Offline CaptainQuantum

  • Knight
  • ***
  • Renown: 44
  • Infamy: 11
  • cRPG Player
    • View Profile
  • Faction: The 22nd Battalion
  • Game nicks: Quant, Quantum
Re: Need some math. Mathematical idea for balancing weapons.
« Reply #29 on: November 10, 2011, 12:04:08 am »
0
Ah no problem, I find chadz' just as easy to read because I do both, it did take me a while to decipher how C code works though, since I was primarily a VB.net programmer until recently. I prefer handwritten or Open office maths, since you get beautiful looking notes/equations. I guess my preference is just due to the amount of integrals I encounter per day, essentially the prettier they are the less time I need to spend working out what I have to do with them.

On the matter at hand:
I think my method is too simplistic, since for poles length is a huge tradeoff for how well you can fight in a group. But for other weapon types length becomes majorly important. My thinking is however that length becomes less important the longer the average length of that weapon class is. For example a polearm user will not care too much for range over the average, but for a 2h it is a much higher advantage to get that extra range. Perhaps the value of the range in the balance model should matter less as higher lengths are reached. As for how though, I will need to think a little more.
« Last Edit: November 10, 2011, 12:10:20 am by CaptainQuantum »