Jump to content
  • 0

Combat Formulas and stats


froggy

Question

I keep running into this problem.

 

Basically goes like this, i originally based everything on how many stat points you get per level, with static hp/mana increases, leaving the rest of the stats at zero per level(having various starting stat numbers for different classes) and then basing item requirements off of your base stats.

 

So what i can't understand, based on how the formulas work, low stat changes will result in almost no changes to the effect the stat is supposed to have, e.g defense for phys dmg reduction. If i then change the stats of an item to 25 defense (to have a good base start of balancing the game), then a player will be at 100~ defense at level 5 just to have defense actually impact combat, because if i don't increase the stats of items by a lot per tier there would be almost no change at all in damage taken/given, right? And then the higher numbers you reach the less effective it is going to be?

 

What i'm trying to say is i don't want players to have to max out their stats and have 1500 hp at level 20, and then have several hundred defense from items aside from their innate stat just to negate some damage.

 

Can i change how this works?

Link to comment
Share on other sites

22 answers to this question

Recommended Posts

  • 1

There should be a file called formulas.xml alongside your server configuration files which has the damage formulas in it for all three types of damage.

 

<?xml version="1.0" encoding="utf-8"?>

<!--formulas.xml generated automatically by Intersect Server.

Here you can modify formulas used in the Intersect Engine. The three main formulas are for calculating Physical, Magical, and True Damage.

The following functions can be used:
Random(min,max):		Returns an integer value between min and max.

The following variables can be used:
BaseDamage:					Base damage of weapon or spell used.
ScalingStat:				Value of stat that was selected in the item/spell editor to scale with the attack.
ScaleFactor:				Value set in editors for how spell/weapon should scale off of the scaling stat.
CritFactor:					Value to multiply potential damage by if the attack is a critical strike. (Server provides 0 is not a crit, and 2 if it is a crit)

A_Attack:						Attackers attack stat.
A_Defense: 					Attackers defense stat.
A_Speed:						Attackers speed stat.
A_AbilityPwr				Attackers ability power stat.
A_MagicResist:			Attackers magic resist stat.

V_Attack:						Victims attack stat.
V_Defense: 					Victims defense stat.
V_Speed:						Victims speed stat.
V_AbilityPwr				Victims ability power stat.
V_MagicResist:			Victims magic resist stat.

-->
<Formulas>
  <PhysicalDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025) * (100 / (100 + V_Defense))</PhysicalDamage>
  <MagicDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025) * (100 / (100 + V_MagicResist))</MagicDamage>
  <TrueDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025)</TrueDamage>
</Formulas>

 

Link to comment
Share on other sites

  • 0

See my question about the formula and the Jc's answer.

And, on intersect's site.

https://www.freemmorpgmaker.com/docs/en/Game_Design/Content_Editors/Items/UsageExamples.html

Have a little explain of the combat content.

 

Maybe you can use this knowledge and make changes on formula yourself, and try use the stats like a variables of function.

Variables

1 hour ago, Joyce said:

A_Attack: Attackers attack stat. A_Defense: Attackers defense stat. A_Speed: Attackers speed stat. A_AbilityPwr Attackers ability power stat. A_MagicResist: Attackers magic resist stat. V_Attack: Victims attack stat. V_Defense: Victims defense stat. V_Speed: Victims speed stat. V_AbilityPwr Victims ability power stat. V_MagicResist: Victims magic resist stat.

Function

1 hour ago, Joyce said:

<Formulas> <PhysicalDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025) * (100 / (100 + V_Defense))</PhysicalDamage> <MagicDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025) * (100 / (100 + V_MagicResist))</MagicDamage> <TrueDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025)</TrueDamage> </Formulas>

 

I hope that helps. :3_grin:

Link to comment
Share on other sites

  • 0

@Joyce 

I know about the formula and that you can change them yourself. However i don't speak math, and i don't know what the changes i can make would mean. I understand how to read the lines, but the direct change in the game i have no idea.

 

@Weylon Santana

It did not help.. I still don't get it.

 

I am wondering what the direct change in phys dmg/defensive mitigation means if i were to alter the formulas

Link to comment
Share on other sites

  • 0

I think the easiest way to SEE your changes directly would be to make an excel sheet and just try out different values. 

In the end you'll likely want an excel sheet for calculating item progression/stat budgets anyway or you'd just get a royal mess with itemization.

 

It's probably boring and hard work making a damage formula you're happy with. But probably worth it in the end. :)

Link to comment
Share on other sites

  • 0
3 hours ago, Miharukun said:

Try to mess around with the formula.xml . I tried like 40+ times to finally found the best formula for me. xD

What parts of the formula did you make changes to?

 

2 hours ago, Joyce said:

I think the easiest way to SEE your changes directly would be to make an excel sheet and just try out different values. 

In the end you'll likely want an excel sheet for calculating item progression/stat budgets anyway or you'd just get a royal mess with itemization.

 

It's probably boring and hard work making a damage formula you're happy with. But probably worth it in the end. :)

No idea how to do any of that. I just want defense to have more of an impact than it does now

Link to comment
Share on other sites

  • 0

Can i somehow simplify the combat formulas? Or is there some purpose to the current system i'm not seeing? Instead of having it do 1:1 for damage/defense.

 

I've been messing with the formula, but i don't see the connection to the damage output and damage mitigation.

Link to comment
Share on other sites

  • 0

I'm not entirely sure how well the Magic Damage scaling works on this, as Magic Defense isn't a pure stat whereas Defense is. (could always swap V_MagicResist out for V_Defense!) Scratch that, it is. Nor am I 100% certain about the True Damage scaling (If your target's defense doesn't raise equally to your own attack a physical/magical strike might deal more damage than a true strike in some cases). But stats have a more noticable impact like this.

 

This excel sheet has the equivalent calculations in it: http://www.ascensiongamedev.com/resources/filehost/b6847fa90ae288d94c9aa7f054b76e74.xlsx

 

<?xml version="1.0" encoding="utf-8"?>

<!--formulas.xml generated automatically by Intersect Server.

Here you can modify formulas used in the Intersect Engine. The three main formulas are for calculating Physical, Magical, and True Damage.

The following functions can be used:
Random(min,max):		Returns an integer value between min and max.

The following variables can be used:
BaseDamage:					Base damage of weapon or spell used.
ScalingStat:				Value of stat that was selected in the item/spell editor to scale with the attack.
ScaleFactor:				Value set in editors for how spell/weapon should scale off of the scaling stat.
CritFactor:					Value to multiply potential damage by if the attack is a critical strike. (Server provides 0 is not a crit, and 2 if it is a crit)

A_Attack:						Attackers attack stat.
A_Defense: 					Attackers defense stat.
A_Speed:						Attackers speed stat.
A_AbilityPwr				Attackers ability power stat.
A_MagicResist:			Attackers magic resist stat.

V_Attack:						Victims attack stat.
V_Defense: 					Victims defense stat.
V_Speed:						Victims speed stat.
V_AbilityPwr				Victims ability power stat.
V_MagicResist:			Victims magic resist stat.

-->
<Formulas>
  <PhysicalDamage>Random((BaseDamage * (ScalingStat * ScaleFactor)) * CritFactor - (V_Defense * 2), (BaseDamage * (ScalingStat * ScaleFactor)) * CritFactor - (V_Defense * 1.25))</PhysicalDamage>
  <MagicDamage>Random((BaseDamage * (ScalingStat * ScaleFactor)) * CritFactor - (V_MagicResist * 2), (BaseDamage * (ScalingStat * ScaleFactor)) * CritFactor - (V_MagicResist * 1.25))</MagicDamage>
  <TrueDamage>Random(BaseDamage * ((ScalingStat * ScaleFactor) / 1.02) * CritFactor, (BaseDamage * (ScalingStat * ScaleFactor) * CritFactor)</TrueDamage>
</Formulas>

 

Link to comment
Share on other sites

  • 0

@Joyce

 

Thank you so much for taking the time to help me :) 

 

I've been trying various inputs in the excel document and it's looking great! (numbers wise, 125 def compared to 12 base and 50 attack power is 350-444 dmg for example, completely reasonable numbers once players reach a bit higher levels)

 

A few questions with the formula you wrote, if someone has high enough defense compared to the attackers values, they'll take negative damage resulting in them getting healed instead of doing 0 or any low amount,

 

And spells with negative(healing spells) deal damage rather than heal. I think something is wrong with the formula? How do i fix this?

 

 

 

Link to comment
Share on other sites

  • 0
2 minutes ago, SCTrav said:

A few questions with the formula you wrote, if someone has high enough defense compared to the attackers values, they'll take negative damage resulting in them getting healed instead of doing 0 or any low amount,

 

And spells with negative(healing spells) deal damage rather than heal. I think something is wrong with the formula? How do i fix this?

I've noticed that as well, and thought it was rather funny.

I'm not sure how to fix that with the way damage is done now. In actual code I'd just set it to 0 if it were going onto the negatives, but I can't do that here. Not entirely sure why the system allows for negative numbers in the first place though.

 

There's probably a better way to get a similar result without the whole negative values thing. Not really a math wizard, just a little rough sketch for calculating damage.

Link to comment
Share on other sites

  • 0
12 hours ago, Joyce said:

I've noticed that as well, and thought it was rather funny.

I'm not sure how to fix that with the way damage is done now. In actual code I'd just set it to 0 if it were going onto the negatives, but I can't do that here. Not entirely sure why the system allows for negative numbers in the first place though.

 

There's probably a better way to get a similar result without the whole negative values thing. Not really a math wizard, just a little rough sketch for calculating damage.

 

Turn armor into a percent with a max threshold of 1000 armor (I personally don't think anyone should have over 1,000 armor or resist, and if they do the formula can be adjusted), then multiply our damage by that percent to get a percent of our damage. Then we minus that percent of our damage from our original damage. If you go over 1,000 armor or resist, the calculation will break. It can be easily fixed though. Ill post the formula here, but I've also piggy backed off of Joyce spread sheet to show you what is actually going on with the calculations.

 

<?xml version="1.0" encoding="utf-8"?>

<!--formulas.xml generated automatically by Intersect Server.

Here you can modify formulas used in the Intersect Engine. The three main formulas are for calculating Physical, Magical, and True Damage.

The following functions can be used:
Random(min,max):		Returns an integer value between min and max.

The following variables can be used:
BaseDamage:					Base damage of weapon or spell used.
ScalingStat:				Value of stat that was selected in the item/spell editor to scale with the attack.
ScaleFactor:				Value set in editors for how spell/weapon should scale off of the scaling stat.
CritFactor:					Value to multiply potential damage by if the attack is a critical strike. (Server provides 0 is not a crit, and 2 if it is a crit)

A_Attack:						Attackers attack stat.
A_Defense: 					Attackers defense stat.
A_Speed:						Attackers speed stat.
A_AbilityPwr				Attackers ability power stat.
A_MagicResist:			Attackers magic resist stat.

V_Attack:						Victims attack stat.
V_Defense: 					Victims defense stat.
V_Speed:						Victims speed stat.
V_AbilityPwr				Victims ability power stat.
V_MagicResist:			Victims magic resist stat.

-->
<Formulas>
  <!-- Old Formulas
  <PhysicalDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025) * (100 / (100 + V_Defense))</PhysicalDamage>
  <MagicDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025) * (100 / (100 + V_MagicResist))</MagicDamage>
  <TrueDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025)</TrueDamage>
  End Old Formulas-->

  <!-- New Formulas! 
  We turn our armor/resist into % damage reduction, by turning armor/resist into a %.
  Then multiplying our damage by that to get that % of our damage, and we subtract from our original damage
  to get the mitigated amount.-->
    <PhysicalDamage>Random((BaseDamage + ScalingStat * ScaleFactor * CritFactor) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (V_Defense * 0.001), (BaseDamage + ScalingStat * ScaleFactor * CritFactor * 1.2) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (V_Defense * 0.001))</PhysicalDamage>
  <MagicDamage>Random((BaseDamage + ScalingStat * ScaleFactor * CritFactor) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (V_MagicResist * 0.001), (BaseDamage + ScalingStat * ScaleFactor * CritFactor * 1.2) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (V_MagicResist * 0.001))</MagicDamage>
  <TrueDamage>Random((BaseDamage + ScalingStat * ScaleFactor * CritFactor) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (0.001), (BaseDamage + ScalingStat * ScaleFactor * CritFactor * 1.5) - (BaseDamage + ScalingStat * ScaleFactor * CritFactor) * (0.001))</TrueDamage>
</Formulas>

 

I have confirmed it works accurately from spreadsheet to actual game play, also in the spreadsheet you will see tags with <--EDIT ME: for ease of use, anything else isn't used in the calculations currently. ScalingStat was left out of physical and magical calculations in the spreadsheet since it cant represent both in the math, with the way Intersect's formulas work. So I just used A_Attack, and A_AbilityPwr instead, just to get a representation in the sheet. True damage calculation does use it, to give you an idea of how its going to be calculated though. The maximum damage may be adjusted to fit your needs by editing the '1.2' after CritFactor in the formula to something like 1.1 or 1.5, as a side note.

 

 

 

 

New Combat Formulas.xlsx

Link to comment
Share on other sites

  • 0
4 hours ago, Joyce said:

Hmm, that would work in theory. But would also make Defense/Magic Resist completely irrelevant as a stat to put points into.

 

 

The defense/resist is used in the calculation to get the mitigation, so I am not sure what you mean?

 

Example, 1000 armor is 100% mitigation. 500 armor is 0.50% mitigation and so forth.

 

So if we do 100 damage and our enemy has 500 armor, which we are talking high level here than our damage is reduced by 0.50%. I just used even numbers here so we can see how it works. Getting back to your point, if you have 0 armor and you don't put stat points into it, you are always going to have 0% mitigation. 

 

(V_Defense * 0.001)

 

The above piece of code for the formula doesn't make armor/resist irrelevant it just converts it to a percent based on 1000 being 100%.

Not sure if you seen my note at the bottom, about testing it in-game and not theorizing it. Give it a try.

 

 

The only thing you would have to make sure of is, have Scaling Amount % to be 100 when creating classes and weapons for the spreadsheet to transpose accurately to game. I read my previous post and it did seem a little confusing, sorry I did it late last night. What I was trying to say was the formulas in excel are only choosing the actual values of A_Attack and A_AbilityPwr since it isn't set up to differentiate when you just choose scaling stat like Intersect is, sorry about that.

Link to comment
Share on other sites

  • 0

It doesn't make the STATS worthless, just makes the ability to choose the stats when investing stat points from levelling worthless. A single point isn't going to get you anywhere.

 

There's ways to work around that, sure. But it's also not a perfect solution to the problem.

Link to comment
Share on other sites

  • 0
58 minutes ago, Joyce said:

It doesn't make the STATS worthless, just makes the ability to choose the stats when investing stat points from levelling worthless. A single point isn't going to get you anywhere.

 

There's ways to work around that, sure. But it's also not a perfect solution to the problem.

 

Based on the formula 1000 armor/resist is 100% mitigation.

 

That means 1 point of armor is going to = 0.001% mitigation.

If you are going to sit at 1 Attack, 1 Base damage then you are right, 1 armor isn't going to do anything for you. You can stack armor all day and will barely see that 2 dmg, go to 1. It is not supposed to completely negate damage into the ground, it only negates a % of it. So you are right the armor isn't what is actually being factored, its just being used as a % of your damage you are receiving/doing. The actual change is in your final damage output. Its supposed to let players with low stats still do some sort of damage to Npc's/players with 1000 armor/resist without negative results.

 

This is meant to be a scaling calculation so the higher the stats go the better the calculations.

To address the main issue though, adjust the conversion factor from 0.001 to 0.01 or whatever is desired. This makes your max armor threshold 100 though if you make it 0.01, so that's why I didn't choose it by default. You just have to tinker with the conversion to get desirable results. You should always know how high you want your MAX level player with MAX armor and MAX damage to top out at anyway.

 

Again you are right its not perfect (I never thought it was), but for what is currently available I would go with mitigation instead of flat values of Attack - Defense, otherwise we see stuff like in a previous post where high armor values start giving you negative values... Here is a changed sheet, to anyone who would like it.

New Combat Formulas.xlsx

Link to comment
Share on other sites

  • 0
Just now, SCTrav said:

@StalysRex

@Joyce

I am so confused.. Playing around the the latest excel sheet Stalys posted, the numbers are fine (meaning i can absolutely work with them)

Can i? Should i? :)

 

 

You can, just let me know if you run into any problems. Like I told Joyce this way of calculating isn't a flat Attack - Defense, it uses your armor to mitigate your damage, and at lower levels with low stats its hard to notice. Again that's what the excel sheet is for, so you can tailor it to how you want. If the numbers work for you, go for it. Just know that if you use these calculations any player with over 1000 Armor/Resist will have issues. If you need further help tinkering with it you can PM me.

Link to comment
Share on other sites

  • 0
Just now, StalysRex said:

 

You can, just let me know if you run into any problems. Like I told Joyce this way of calculating isn't a flat Attack - Defense, it uses your armor to mitigate your damage, and at lower levels with low stats its hard to notice. Again that's what the excel sheet is for, so you can tailor it to how you want. If the numbers work for you, go for it. Just know that if you use these calculations any player with over 1000 Armor/Resist will have issues. If you need further help tinkering with it you can PM me.

Give me some time and i'll rebalance everything(its not much to test atm)and give it a playthrough, and i'll let you know, thanks! :) 

Link to comment
Share on other sites

  • 0
56 minutes ago, SCTrav said:

Give me some time and i'll rebalance everything(its not much to test atm)and give it a playthrough, and i'll let you know, thanks! :) 

 

Happy to help.

 

The requirements needed, in-game are Scaling stat at 100% for classes and weapons. I noticed the true damage wasn't being show properly in the excel sheet for the weapon test, so I adjusted it. Now it should reflect properly from sheet to in-game.

 

New Combat Formulas.xlsx

Link to comment
Share on other sites

×
×
  • Create New...