• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 20:50
CEST 02:50
KST 09:50
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
BGE Stara Zagora 2025: Info & Preview9Code S RO12 Preview: GuMiho, Bunny, SHIN, ByuN3The Memories We Share - Facing the Final(?) GSL44Code S RO12 Preview: Cure, Zoun, Solar, Creator4[ASL19] Finals Preview: Daunting Task30
Community News
GSL Ro4 and Finals moved to Sunday June 15th7Weekly Cups (May 27-June 1): ByuN goes back-to-back0EWC 2025 Regional Qualifier Results26Code S RO12 Results + RO8 Groups (2025 Season 2)3Weekly Cups (May 19-25): Hindsight is 20/20?0
StarCraft 2
General
BGE Stara Zagora 2025: Info & Preview Serious Question: Mech CN community: Firefly accused of suspicious activities Jim claims he and Firefly were involved in match-fixing The Memories We Share - Facing the Final(?) GSL
Tourneys
$5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays Master Swan Open (Global Bronze-Master 2) $1,200 WardiTV June (June 4th-June 15th) SOOPer7s Showmatches 2025
Strategy
[G] Darkgrid Layout Simple Questions Simple Answers [G] PvT Cheese: 13 Gate Proxy Robo
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 476 Charnel House Mutation # 475 Hard Target Mutation # 474 Futile Resistance Mutation # 473 Cold is the Void
Brood War
General
BW General Discussion FlaSh Witnesses SCV Pull Off the Impossible vs Shu Will foreigners ever be able to challenge Koreans? BGH auto balance -> http://bghmmr.eu/ Battle.net is not working
Tourneys
Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET [Megathread] Daily Proleagues [ASL19] Grand Finals
Strategy
I am doing this better than progamers do. [G] How to get started on ladder as a new Z player
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Mechabellum Monster Hunter Wilds
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
LiquidLegends to reintegrate into TL.net
Heroes of the Storm
Simple Questions, Simple Answers
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia TL Mafia Community Thread TL Mafia Plays: Diplomacy TL Mafia: Generative Agents Showdown Survivor II: The Amazon
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread European Politico-economics QA Mega-thread Canadian Politics Mega-thread
Fan Clubs
Maru Fan Club Serral Fan Club
Media & Entertainment
Korean Music Discussion [Manga] One Piece
Sports
2024 - 2025 Football Thread Formula 1 Discussion NHL Playoffs 2024 NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Cleaning My Mechanical Keyboard How to clean a TTe Thermaltake keyboard?
TL Community
The Automated Ban List
Blogs
Heero Yuy & the Tax…
KrillinFromwales
Research study on team perfo…
TrAiDoS
I was completely wrong ab…
jameswatts
Need Your Help/Advice
Glider
Trip to the Zoo
micronesia
Poker
Nebuchad
Info SLEgma_12
SLEgma_12
Customize Sidebar...

Website Feedback

Closed Threads



Active: 14927 users

Math genius needed for game making

Blogs > shannn
Post a Reply
1 2 Next All
shannn
Profile Blog Joined May 2010
Netherlands2891 Posts
Last Edited: 2012-01-06 10:22:08
January 06 2012 09:54 GMT
#1
Hello dear reader!

If you're here because you feel you're a math genius :D GREAT! else not so great but thanks for reading!
I'm currently making an indie RPG game and I'm at the point of my battle system in my game that I need to have a formula to calculate the amount of damage inflicted on the target.

I have my own thought up formula for calculating damage which works decently but damage is significantly different within each level and I figure that there are math geniuses here on TL that could very likely think up of a better way (or a programmer :D).

So I'm asking you as a math genius if you can think of a decent formula with the above attributes in mind that doesn't increase exponentially for each level. I will use the same for magic attacking and healing spells, just have to switch some modifiers then I think. So help me out! :D

My current formula is the following:
( ( (CharAttackingLevel * 10 ) + ( CharAttackingLevel * CharAttackingPower ) + ( CharAttackingLevel * CharAttackingBasePower ) ) - ( ( CharDefendingLevel * CharDefendingDefense ) + ( CharDefendingLevel * CharDefendingBaseDefense ) ) ) + RandomDamage

Notes:
CharAttackingLevel: Character level that's attacking
CharAttackingPower: The amount of attack power the character that's attacking has
CharAttackingBasePower: The base amount of attack power of the character attacking
RandomDamage: random number between 0 and 10 x CharAttackingLevel
CharDefendingLevel: Character level that's defending.
CharDefendingDefense: The amount of defense power the character that's defending has.
CharDefendingBaseDefense: The base amount of defense power of the character attacking

I tried to attack with my characters a couple of dozen times and it seems pretty random.
However it's quite significantly random as in the more attack power combined with level against lesser base defense the more damage significantly a character does and I prefer to avoid this as I'll also use this formula for my monsters against my characters.

Reason for this is because a level 3 character did a 98 damage (crit?) while a lvl 1 did 12 damage and they have same amount of attack power / defense power against a level 1 target monster. The difference is the level that they're attacking with obviously and because of the high modifier I listed.

Feels like once a character hits lvl 5 it's already hitting 500+ or more with basic stats.
And it can occur that the amount of damage it generates can become negative.
I want to have a decent formula but I don't know how to think up of one and that's where you math genius come along! :D So help me out

**
http://www.teamliquid.net/forum/viewpost.php?post_id=6321864 Epic post.
Silidons
Profile Blog Joined September 2010
United States2813 Posts
January 06 2012 10:10 GMT
#2
i've never seen how a video game is made in my life, but it seems there would be a problem with the last line + RandomDamage when you stated that RandomDamage= random # 0-10xCharAttackingLevel. That means for lvl 1's they either get +1 or +0 no matter what random number they pull.

seems odd to me also how you take into account both the CharDefendingDefense + the CharDefendingBaseDefense. Wouldn't it be much easier to completely take out the CharDefendingBaseDefense and just go purely off of CharDefendingDefense?
"God fights on the side with the best artillery." - Napoleon Bonaparte
mrafaeldie12
Profile Joined July 2011
Brazil537 Posts
January 06 2012 10:13 GMT
#3
Well if you're going to add a random number you can't really complain about damage being irregular!!!You need to add a variant between a range(maybe it increases with level or w/e),usually most programming languages can generate a sudo random number within a certain rage with a function.

But for starters,try organizing your thread and putting the Problem up front,the information is quite disperse amidst your paragraphs!
"..it all comes thumbling down thumbling down thumblin down"
shannn
Profile Blog Joined May 2010
Netherlands2891 Posts
Last Edited: 2012-01-06 10:25:50
January 06 2012 10:19 GMT
#4
@Sillidons:
the randomDamage is the generated random number ranging from 0 till 10 times attacker level.
So for a level 1 it's always going to be from including 0 till excluding 10 (0 - 9 will be the additional random damage for a level 1 and 0-18 for level 2 etc)

Well I was thinking if the user has no attacking power from items then he won't do any damage. The base attacking power would make it so that the attacker at very least does some base damage.

@mrafaeldie12:
I'm not complaining about irregular damage Just wanted a better formula as I'm not a math genius myself :D

Okay thanks for the tip! :D will put up the problem on top :d
http://www.teamliquid.net/forum/viewpost.php?post_id=6321864 Epic post.
jrkirby
Profile Blog Joined August 2010
United States1510 Posts
January 06 2012 10:24 GMT
#5
Every k is a constant that you define by experimentation.

Defence% = (1- ( 1/(k * CharDefendingDefense) ) )

RawRegularDamage = sqrt ( k * CharAttackingLevel * CharAttackingPower )

PeircingDamage = sqrt ( k * CharAttackingLevel * CharAttackingBasePower )

Defence = k * ( k * CharDefendingLevel + CharDefendingBaseDefense )

FinalRegularDamage = RawRegularDamage - Defence (can't be less than 0)

FinalDamage = (FinalRegularDamage + PeircingDamage + RandomDamage) * Defence% (then round)


A system based off both wc2 and wc3 damage systems, I've read about them both and incorporated what i thought was the best way to take your inputs and apply what i know from them and two rules:

Make things simple (for yourself), so try not to have many operations in one equation.

Make things linear (or less). if you multiply two variables together squareroot before doing anything else.

I'd love to hear if this system helps. You had alot of variable you wanted to include, I wasn't sure how you wanted them to work, but i tried my best to make an equitable system.
shannn
Profile Blog Joined May 2010
Netherlands2891 Posts
January 06 2012 10:30 GMT
#6
On January 06 2012 19:24 jrkirby wrote:
Every k is a constant that you define by experimentation.

Defence% = (1- ( 1/(k * CharDefendingDefense) ) )

RawRegularDamage = sqrt ( k * CharAttackingLevel * CharAttackingPower )

PeircingDamage = sqrt ( k * CharAttackingLevel * CharAttackingBasePower )

Defence = k * ( k * CharDefendingLevel + CharDefendingBaseDefense )

FinalRegularDamage = RawRegularDamage - Defence (can't be less than 0)

FinalDamage = (FinalRegularDamage + PeircingDamage + RandomDamage) * Defence% (then round)


A system based off both wc2 and wc3 damage systems, I've read about them both and incorporated what i thought was the best way to take your inputs and apply what i know from them and two rules:

Make things simple (for yourself), so try not to have many operations in one equation.

Make things linear (or less). if you multiply two variables together squareroot before doing anything else.

I'd love to hear if this system helps. You had alot of variable you wanted to include, I wasn't sure how you wanted them to work, but i tried my best to make an equitable system.

Hey man, :o I figured 3d games would have complicated formula's :D I can work with that thanks man!

Thanks for the tips, much appreciated :D will post later how the formula has worked out :D
http://www.teamliquid.net/forum/viewpost.php?post_id=6321864 Epic post.
UniversalSnip
Profile Blog Joined July 2010
9871 Posts
Last Edited: 2012-01-06 10:40:35
January 06 2012 10:39 GMT
#7
I don't know why you want both character attacking level and character attacking power to be factored into the equation. Presumably higher level characters will have higher attacking power from items or something, so you have double scaling on the damage and this makes the numbers much harder to fine tune. Instead, just make levels add to your attacking power stat and take raw character level out of the equation, this is how it works for almost every game ever, it'll simplify things and make then numbers much easier to fine tune and less prone to huge variation. Same goes for defense.
"How fucking dare you defile the sanctity of DotA with your fucking casual plebian terminology? May the curse of Gaben and Volvo be upon you. le filthy casual."
shannn
Profile Blog Joined May 2010
Netherlands2891 Posts
January 06 2012 10:42 GMT
#8
On January 06 2012 19:39 UniversalSnip wrote:
I don't know why you want both character attacking level and character attacking power to be factored into the equation. Presumably higher level characters will have higher attacking power from items or something, so you have double scaling on the damage and this makes the numbers much harder to fine tune. Instead, just make levels add to your attacking power stat and take raw character level out of the equation, this is how it works for almost every game ever, it'll simplify things and make then numbers much easier to fine tune and less prone to huge variation. Same goes for defense.

I see, that is indeed better. I don't want to fine tune numbers on things like this
Thanks for the suggestion. Will change the equations then.
http://www.teamliquid.net/forum/viewpost.php?post_id=6321864 Epic post.
jrkirby
Profile Blog Joined August 2010
United States1510 Posts
January 06 2012 10:50 GMT
#9
On January 06 2012 19:39 UniversalSnip wrote:
I don't know why you want both character attacking level and character attacking power to be factored into the equation. Presumably higher level characters will have higher attacking power from items or something, so you have double scaling on the damage and this makes the numbers much harder to fine tune. Instead, just make levels add to your attacking power stat and take raw character level out of the equation, this is how it works for almost every game ever, it'll simplify things and make then numbers much easier to fine tune and less prone to huge variation. Same goes for defense.


Honestly I would have taken many of his variables out as well, such as character level. But he said he wants to use them. So I thought of an interesting way to include them using concepts I learned from famous games. And since I didn't know how his game worked, I added many spots for him to add constants to tweak the system appropriately.

Also, @OP, if instead of just adding the random damage, you could take it out, and then at the end choose a number between FinalDamage/2 and FinalDamage. This is a trick in wc2's damage system. But in the formula I told you to just add it in near the end because that was what you were doing originally.
Talin
Profile Blog Joined September 2010
Montenegro10532 Posts
Last Edited: 2012-01-06 10:56:02
January 06 2012 10:50 GMT
#10
Is there a design reason why you're coming up with this obscure, convoluted way of calculating damage that the player will probably never understand and be able to consider as part of his strategy during combat without doing extensive math?

You don't need a math genius at all, you just need to keep things simple because that is the foundation of good game design. A few good guiding principles:

- Things should be kept simple to the point where a player can both understand level progression AND be able to instantaneously tell how much damage will his characters' attack deal to the creature, without consciously doing math.
- Don't add arbitrary attributes that increase the complexity of calculations but don't add to the depth of gameplay (in particular, most attack skill / defense skill stats I've seen in various games I played have been completely redundant and could have been easily avoided).
- Keep the numbers low, preferably in double digits, so that the human brain can process calculations spontaneously without requiring the player to actively think about it and distracting him from the game experience.

Consider this situation:
- Your character does 5-7 damage with his Broadsword. The opponent has 10 health and 3 armor (damage reduction). You instantly know, without having to consciously consider it, that you'll be able to do 2-4 damage to the opponent, it's extremely intuitive.

With more complex calculations, you usually have to make a choice between revealing how the mechanics work - which will cause your players to actually work out the calculations before / during combat (if turn based) or during the leveling process when they make their choices regarding character progression - OR hiding the mechanics behind simple tooltips like 'this attack will cause 37-54 damage to this creature" (where the game does the calculations under the hood, and only displays results to the player) - in this case, the player has no real understanding of the mechanics of the game and the decisions he makes.

Do yourself a favor and don't follow the flawed design philosophies of the 90s RPGs. Simplicity is your friend!
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
January 06 2012 10:52 GMT
#11
that is not what a mathmatician do. sorry
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
shannn
Profile Blog Joined May 2010
Netherlands2891 Posts
Last Edited: 2012-01-06 10:57:34
January 06 2012 10:54 GMT
#12
On January 06 2012 19:50 jrkirby wrote:
Show nested quote +
On January 06 2012 19:39 UniversalSnip wrote:
I don't know why you want both character attacking level and character attacking power to be factored into the equation. Presumably higher level characters will have higher attacking power from items or something, so you have double scaling on the damage and this makes the numbers much harder to fine tune. Instead, just make levels add to your attacking power stat and take raw character level out of the equation, this is how it works for almost every game ever, it'll simplify things and make then numbers much easier to fine tune and less prone to huge variation. Same goes for defense.


Honestly I would have taken many of his variables out as well, such as character level. But he said he wants to use them. So I thought of an interesting way to include them using concepts I learned from famous games. And since I didn't know how his game worked, I added many spots for him to add constants to tweak the system appropriately.

Also, @OP, if instead of just adding the random damage, you could take it out, and then at the end choose a number between FinalDamage/2 and FinalDamage. This is a trick in wc2's damage system. But in the formula I told you to just add it in near the end because that was what you were doing originally.

Yea I've simplified things and now I'm only using 2 variables which is attacking power and defending power.


On January 06 2012 19:50 Talin wrote:
Is there a design reason why you're coming up with this obscure, convoluted way of calculating damage that the player will probably never understand and be able to consider as part of his strategy during combat without doing extensive math?

You don't need a math genius at all, you just need to keep things simple because that is the foundation of good game design. A few good guiding principles:

- Things should be kept simple to the point where a player can both understand level progression AND be able to instantaneously tell how much damage will his characters' attack deal to the creature, without consciously doing math.
- Don't add arbitrary attributes that increase the complexity of calculations but don't add to the depth of gameplay (most attack skill / defense skill stats I've seen in various games I played have been completely redundant and could have been easily avoided).
- Keep the numbers low, preferably in double digits, so that the human brain can process calculations spontaneously without requiring the player to actively think about it.

Consider this situation:
- Your character does 5-7 damage with his Broadsword. The opponent has 10 health and 3 armor (damage reduction). You instantly know, without having to consciously consider it, that you'll be able to do 2-4 damage to the opponent, it's extremely intuitive.

With more complex calculations, you usually have to make a choice between revealing how the mechanics work - which will cause your players to actually work out the calculations before / during combat (if turn based) or during the leveling process when they make their choices regarding character progression - OR hiding the mechanics behind simple tooltips like 'this attack will cause 37-54 damage to this creature" (where the game does the calculations under the hood, and only displays results to the player) - in this case, the player has no real understanding of the mechanics of the game and the decisions he makes.

Do yourself a favor and don't follow the flawed design philosophies of the 90s RPGs. Simplicity is your friend!

I have no idea how the 90s RPGs work tbh. I'm literally just thinking it on the fly and then simplify after.
With input from you lovely TL people I can work much better on things I don't really want to think a lot about :D
http://www.teamliquid.net/forum/viewpost.php?post_id=6321864 Epic post.
micronesia
Profile Blog Joined July 2006
United States24637 Posts
January 06 2012 11:20 GMT
#13
On January 06 2012 19:50 Talin wrote:
Do yourself a favor and don't follow the flawed design philosophies of the 90s RPGs. Simplicity is your friend!

I'm not going to say I disagree with your proposed style of damage calculation, but I'm not sure if I agree that the way the "90s RPGs" did it was necessarily bad either. Being able to calculate details regarding the damage you can do is not necessarily part of a well designed battle system.
ModeratorThere are animal crackers for people and there are people crackers for animals.
UniversalSnip
Profile Blog Joined July 2010
9871 Posts
January 06 2012 11:36 GMT
#14
If you are using spells, you might also want to give some thought to how you will calculate damage from those. The player will expect a different set of factors to be represented in a spell than in an attack.

A simple way of setting priorities for what you expect out of your combat formulas might be as follows:

1) You want them to represent everything the player expects will be contributing to the end result, and nothing that they won't. For example, a player will be very disconcerted if their axe isn't taken into account in the attack calculations, and confused if it is taken into account when casting a healing spell. Think about what the player expects to happen, and try to make the formulas represent that in a simple way.

2) Keep the formulas simple so that you understand them, so that you can more easily tune them, and to ensure that you are not including unnecessary factors that don't fit with point number one.

3) Make the formula scale properly so you don't have people rocketing ahead of the curve or falling behind it.
"How fucking dare you defile the sanctity of DotA with your fucking casual plebian terminology? May the curse of Gaben and Volvo be upon you. le filthy casual."
Rice
Profile Blog Joined July 2007
United States1332 Posts
January 06 2012 11:49 GMT
#15
I don't think a math genius is what you want here tbh...
Freedom will be defended at the cost of civil liberties.
Osmoses
Profile Blog Joined October 2008
Sweden5302 Posts
January 06 2012 12:03 GMT
#16
This seems googlable.

This seems relevant.
Excuse me hun, but what is your name? Vivian? I woke up next to you naked and, uh, did we, um?
shannn
Profile Blog Joined May 2010
Netherlands2891 Posts
Last Edited: 2012-01-06 12:20:30
January 06 2012 12:06 GMT
#17
On January 06 2012 20:36 UniversalSnip wrote:
If you are using spells, you might also want to give some thought to how you will calculate damage from those. The player will expect a different set of factors to be represented in a spell than in an attack.

A simple way of setting priorities for what you expect out of your combat formulas might be as follows:

1) You want them to represent everything the player expects will be contributing to the end result, and nothing that they won't. For example, a player will be very disconcerted if their axe isn't taken into account in the attack calculations, and confused if it is taken into account when casting a healing spell. Think about what the player expects to happen, and try to make the formulas represent that in a simple way.

2) Keep the formulas simple so that you understand them, so that you can more easily tune them, and to ensure that you are not including unnecessary factors that don't fit with point number one.

3) Make the formula scale properly so you don't have people rocketing ahead of the curve or falling behind it.

Ya I did like Talin said and just did attacking power - defense to start simple for attacks. And then I coded each level will now give a constant amount of attacking power and defending power to the player/monsters.
This way it's simple to keep track of the amount of damage they'll take/receive and what a player can expect.

I'll actually do the same with magic power except the constant amount that is added each level is higher than attack.

And sorry guys for those saying that a mathematician doesn't do this :D It looks like math so I asked for a mathematician

Anyways, I thank everyone for giving their input. It has been really helpful so far ^^

Edit:
I've actually been to some other site that gave similar answers (stackoverflow *cough*). It was just too much for my head at the time.
Hmm should probably go rest and stop coding for few hours ^^

Thanks for the link. Will be helpful!
http://www.teamliquid.net/forum/viewpost.php?post_id=6321864 Epic post.
-_-Quails
Profile Joined February 2011
Australia796 Posts
January 06 2012 13:01 GMT
#18
I started writing a comment, then realised it was turning into a wall so I've put in spoilers. Got a little carried away.

Pretty much I agree that rough calculations on the player side should be possible on the fly, but don't think there's any need for players to actually see the inner workings of combat or be able to completely predict the outcome. A system that is conceptually simple with a lengthier implementation is likely to be easier to fine tune or extend than the simplest system you can implement. And your first-try system is a decent enough starting point when rewritten for simplicity.

Simplifying what is there:
+ Show Spoiler +
Unless there's a concrete reason to have ***BasePower values seperate to ***Power values then there should only be ***Power, with ***BasePower used as the initial value then modified as you level.

This yields:

Damage = ( (CharAttackingLevel * 10 ) + ( CharAttackingLevel * CharAttackingPower ) + RandomDamage) - ( CharDefendingLevel * CharDefendingDefense )

Given your definition of the random damage component this can be rewritten as:

Damage = CharAttackingLevel * ( CharAttackingPower + Random[Range=11..20] ) - CharDefendingLevel * CharDefendingDefense

This formula is a decent start because it is very simple (though it was initially written in a more complicated than necessary manner), and very modifiable.


Comments on random damage
+ Show Spoiler +

The Random function you use and the range assigned are the first things to look at finetuning. Personally, I might consider using a probabilistic function instead of a random number generator and using that to edge the damage towards the low end. That would give scope for "lucky" items to be used to increase the chance of doing a critical amount of damage. I might also have a seperate function for the defending character to boost their defense in the same way. Because I hate the player, I would probably give a chance that you mess up an attack or a defense to the random function.

This would give something like:

Damage = CharAttackingLevel * ( CharAttackingPower + CharAttackingModifier ) - CharDefendingLevel * ( CharDefendingPower + CharDefendingModifier )
Where the modifiers are random or probabilistic functions whose ranges and distributions are adjusted by any factor that you want to affect the outcome.

Armour would shift the range of the defense modifier towards the positive and piercing damage might cause the armour bonus to be ignored.

All the complicated maths is hidden in the modifier functions and all the player needs to know is that item X will make critical hits 3x more likely, or bronze armor reduces damage by 2, or fighting in a tree makes dwarves more likely to miss because they're freaked out by heights. Because the modifiers can be different for every character you should have a lot of scope for balancing fights at various levels.

Level1 damage vs Level 3 damage
+ Show Spoiler +
You got such a big increase between level 1 and level 3 because you multiply everything by the attacker or defender level. Level 3 in your original equation would always have at least 20+2*attackingpower more damage than the level 1 disregarding random. To avoid this then you could use the modifier to reduce the rate of damage increase (perhaps including a logarithmic part) or preferably restrict the use of the level in damage calculation.

Example:
Damage = ( CharAttackingLevel * CharAttackingPower) + CharAttackingModifier - ( CharDefendingLevel * CharDefendingPower ) + CharDefendingModifier

The random part is no longer magnified greatly at higher levels, though you're free to have level modified components in it.

I would actually prefer for levels to not be directly used in damage calculation, and to use them when modifying stats like the attack power instead.
Damage = CharAttackingPower - CharDefendingPower + GreatSecretCombatModifier

With somthing like:
LevelUp
Prereqs:
Delta(Character{Level,AttackingPower,DefendingPower})
Postconditions:
Level' = Level + 1
CharAttackingPower' = CharAttackingPower + Level
CharDefendingPower' = CharDefendingPower + Level
[ AttributeName' = new value of AttributeName]


Complicated 3D stuffz
+ Show Spoiler +
Your damage function should be about as complicated as your fight. If there are lots of different types of item you can use to attack with/defend with/help your character to win and lots of ways to reliably use the terrain to get an advantage then your modifier function should be complicated enough to take all of that into account, whereas if there are few factors affecting a fight it should be extremely simple. Whether there is any need for a 3D component to enter into it depends on whether the orientation and inclination of a player or attack is affected by it.

Something like Tekken uses a simple slightly-more-than-2D approach to determine if blocks will work. That kind of system can be implemented easily enough by having attack-high and attack-low being calculated slightly differently (a helmet might not figure into defense against a low attack).

Unless your player has a huge amount of control over the way they attack and defend there's no point in trying for full 3D fighting. If a player can reliably move around their opponent in every dimension and hit any weak spot they find then having a fully three-dimensional combat system would definitely be justified - with characters, weapons and armor defined for damage or defense at any point and 3D physics used to calculate the forces between sword and shield, etc. At this point you would be simulating combat as if the player was the character and had the control to deliberately aim for the joins of a suit of armor.

If your controls aren't that fine, then you can save yourself a lot of effort. I have yet to play any game that gives you the degree of control that would make such a combat system shine.


"I post only when my brain works." - Reaper9
Kleinmuuhg
Profile Blog Joined September 2010
Vanuatu4091 Posts
January 06 2012 13:23 GMT
#19
okay :

CharAttackingLevel: CAL
CharAttackingPower: CAP
CharAttackingBasePower: CABP
RandomDamage: RD
CharDefendingLevel:CDL
CharDefendingDefense: CDD
CharDefendingBaseDefense: CDBD

Your formular :
( ( (CAL* 10 ) + ( CAL * CAP ) + ( CAL* CABP ) ) - ( ( CDL * CDD) + ( CDL * CDBD ) ) ) + RD

= CAL * (10+CAP+CABP) - CDL *(CDD + CDBD) + RD

This makes it pretty obvious why the CAL has such a huge impact (and maybe easier to find a better solution)

Now how to change this?
Well Im not sure , you could try these ideas :

1.Idea switch any of (10+CAP+CABP) with CAL and try if it works better
CAP *( 10 + CAL + CABP ) - CDL *(CDD + CDBD) + RD More emphasis on CAP , less on CAL
CABP* (10+CAL+CAP) - CDL *(CDD + CDBD) + RD Neither CAL nor CAP change the outcome dramatically
10 *(CABP +CAL+CAP) - CDL *(CDD + CDBD) + RD
Problem: Damage can still become <0 , but Im sure there is a programming trick where you can say if Damage
becomes negative => Damage = 0

2. Idea This"-" sucks, try using "/"

[ CAL * (10+CAP+CABP) / CDL *(CDD + CDBD) ] +RD this of course gives you comma numbers, so idk if you can
round them up


I just read you changed your system. So all of this will be pretty useless. Anyways GL coding.
This is our town, scrub
-_-Quails
Profile Joined February 2011
Australia796 Posts
January 06 2012 13:34 GMT
#20
On January 06 2012 22:23 Kleinmuuhg wrote:

2. Idea This"-" sucks, try using "/"

[ CAL * (10+CAP+CABP) / CDL *(CDD + CDBD) ] +RD this of course gives you comma numbers, so idk if you can
round them up



Using '%' instead of '/' returns an integer.
"I post only when my brain works." - Reaper9
1 2 Next All
Please log in or register to reply.
Live Events Refresh
PiGosaur Monday
00:00
#34
PiGStarcraft548
CranKy Ducklings121
SteadfastSC89
rockletztv 34
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft537
RuFF_SC2 145
Livibee 92
SteadfastSC 90
Nina 74
StarCraft: Brood War
Artosis 905
ZZZero.O 49
Icarus 5
Dota 2
monkeys_forever478
NeuroSwarm77
Counter-Strike
fl0m6836
Fnx 843
Super Smash Bros
hungrybox468
C9.Mang0213
AZ_Axe113
PPMD27
Other Games
summit1g7388
shahzam1316
Day[9].tv1040
ViBE229
Maynarde194
Trikslyr46
Organizations
Other Games
gamesdonequick1192
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Hupsaiya 95
• RyuSc2 30
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Azhi_Dahaki18
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Doublelift6291
Other Games
• Day9tv1040
Upcoming Events
WardiTV Qualifier
10h 11m
Bellum Gens Elite
11h 11m
OSC
15h 11m
The PondCast
1d 9h
Bellum Gens Elite
1d 10h
WardiTV Invitational
1d 10h
Replay Cast
1d 23h
OSC
1d 23h
Bellum Gens Elite
2 days
WardiTV Invitational
2 days
[ Show More ]
Replay Cast
2 days
CranKy Ducklings
3 days
SC Evo League
3 days
Bellum Gens Elite
3 days
Fire Grow Cup
3 days
CSO Contender
3 days
Replay Cast
3 days
SOOP
4 days
SHIN vs GuMiho
Sparkling Tuna Cup
4 days
AllThingsProtoss
4 days
Fire Grow Cup
4 days
Replay Cast
4 days
Replay Cast
5 days
Replay Cast
6 days
WardiTV Invitational
6 days
Liquipedia Results

Completed

CSL Season 17: Qualifier 1
DreamHack Dallas 2025
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
KCM Race Survival 2025 Season 2
NPSL S3
Rose Open S1
CSL Season 17: Qualifier 2
2025 GSL S2
Bellum Gens Elite Stara Zagora 2025
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
ECL Season 49: Europe
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025
PGL Bucharest 2025
BLAST Open Spring 2025

Upcoming

CSL 17: 2025 SUMMER
Copa Latinoamericana 4
CSLPRO Last Chance 2025
CSLAN 2025
K-Championship
SEL Season 2 Championship
Esports World Cup 2025
HSC XXVII
Championship of Russia 2025
Murky Cup #2
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.