Project 1999

Go Back   Project 1999 > Blue Community > Blue Server Chat

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 02-21-2014, 11:32 AM
koros koros is offline
Planar Protector


Join Date: Mar 2011
Posts: 1,127
Default

Quote:
Originally Posted by imajester [You must be logged in to view images. Log in or Register.]
I believe here...

https://code.google.com/p/projecteqemu/source/browse/

I am going to dig around and see if I can find the calc.
Please do post if you find anything solid.
  #2  
Old 02-21-2014, 11:12 AM
Daldaen Daldaen is offline
Planar Protector


Join Date: Jun 2010
Location: Kedge Keep
Posts: 9,062
Default

Quote:
Melee Damage

Brohg writes the following description of melee damage recieved from mobs: "Mob damage is two parts, DB (Damage Base/Bonus or Fixed Damage /Vig), and (1-20)*DI, which is Damage Interval. You can see this by parsing, that there are 20 discrete amounts of damage any mob can deal on a successful hit. It's not quite /random 1 20, because AC makes a big huge difference in how many low hits you have, but you still have the whole range.
If a mob has a damage base of 200, and a damage interval of 20, then (once they hit you) they'll deal either 220 damage, or 240, 260... etc ... 580, or 600 damage."

"High AC (from gear /Vig) reduces the damage taken from the (1-20)*DI portion a lot, making many more low #*DI than high."

So all melee damage has two parts, one wich is random and affected by the AC on your gear, and one part that is never modified by AC. The Shielding effect in particular is extra interesting heresince Shielding affects only the Fixed Damage (and is the only thing that affects it), not the random Damage Interval.


Armor Class

Armor Class is what decides how much damage you take and how often you take damage. It mitigates damage and it makes the mob miss it's attacks against you. The first part of the AC is "mitigation AC" wich is calculated from the worn AC you gain from your gear. Taraddar writes: "Your "mitigation" ac comes from the AC on your gear and is what effects the distribution you get in the 1-20 portion of attacks. Higher ac gets more lower hits etc."

This means that the gear you wear decides how much of the random part ie Damage Interval (as described above) of the damage coming your way actually hits you.

The other part of AC is the "avoidance AC" wich is defined by your Defense Skill and your AGI stat. Taraddar writes: "Normally your defense skill and agility contribute to your "avoidance" ac and increase your chance of being missed. AC from gear doesn't effect this at all."


Attack

Attack, like AC, is also composed of two parts. One is based on your Strength and wielded weapon to decided how hard you hit the mob when you connect. Let's call this Power. Brohg writes: The Power part of Attack is how hard you hit, when you hit. No amount of power will raise your max hit, but those who are familiar with the (1-20)*DI nature of Everquest damage will understand that shifting your average hits higher on the 1-20 scale will lead to much more overall damage. This is what Power does. Power is modified by Offense skill, Strength score, and +ATK mods on items. In combat, Power is opposed by the target's Mitigation.

The other part of Attack decides how often you hit. This is based on your weapon skills. We can also safely assume that your Offense skill is also one part of the calculation. Again, Brohg teaches us: "Displayed "Attack" is Accuracy+Power. Accuracy is how likely one is to hit one's target, and in combat is compared to the Avoidance part of AC (more on that later). Accuracy comes from two sources, Weapon Skills and +Accuracy mods on items."
Is a solid description of how EQ mechanics work... But it doesn't have an exact ATK formula. Just what factors in, no numbers.
  #3  
Old 02-21-2014, 11:31 AM
koros koros is offline
Planar Protector


Join Date: Mar 2011
Posts: 1,127
Default

Atk affects the skewness of the hit distribution curve. General rule on live during Velious was that 10 atk = 1% dps increase at around 1000 atk vs level 60ish npcs. There's going to be some second derivative action going on making it hard to predict exactly how atk alters the curve, especially without hard numbers.
Last edited by koros; 02-21-2014 at 11:33 AM..
  #4  
Old 02-21-2014, 11:50 AM
Swish Swish is offline
Planar Protector

Swish's Avatar

Join Date: Nov 2010
Posts: 20,162
Default

If a druid offers you wolf form, take it [You must be logged in to view images. Log in or Register.]
__________________
  #5  
Old 02-21-2014, 05:28 PM
tristantio tristantio is offline
Fire Giant

tristantio's Avatar

Join Date: Nov 2010
Posts: 888
Default

I was just about to post that (was reading attack.cpp myself).

Important part:

Code:
// This is called when the Mob is the one being hit                                                                                                                                
int32 Mob::GetMeleeMitDmg(Mob *attacker, int32 damage, int32 minhit,
	        float mit_rating, float atk_rating)
{
	float d = 10.0;
	float mit_roll = MakeRandomFloat(0, mit_rating);
	float atk_roll = MakeRandomFloat(0, atk_rating);

	if (atk_roll > mit_roll) {
		float a_diff = atk_roll - mit_roll;
		float thac0 = atk_rating * RuleR(Combat, ACthac0Factor);
		float thac0cap = attacker->GetLevel() * 9 + 20;
		if (thac0 > thac0cap)
			thac0 = thac0cap;

		d -= 10.0 * (a_diff / thac0);
	} else if (mit_roll > atk_roll) {
		float m_diff = mit_roll - atk_roll;
		float thac20 = mit_rating * RuleR(Combat, ACthac20Factor);
		float thac20cap = GetLevel() * 9 + 20;
		if (thac20 > thac20cap)
			thac20 = thac20cap;

		d += 10.0 * (m_diff / thac20);
	}

	if (d < 0.0)
		d = 0.0;
	else if (d > 20.0)
		d = 20.0;

	float interval = (damage - minhit) / 20.0;
        damage -= ((int)d * interval);

	damage -= (minhit * itembonuses.MeleeMitigation / 100);
        damage -= (damage * spellbonuses.MeleeMitigation / 100);
        return damage;
}
And the call to that looks something like this:
Code:
 if (GetClass() == WIZARD || GetClass() == MAGICIAN ||
		                GetClass() == NECROMANCER || GetClass() == ENCHANTER)
			mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 4.0) + armor + 1;
	        else
	                mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 3.0) + (armor * 1.333333) + 1;
		mitigation_rating *= 0.847;

	        mitigation_rating = mod_mitigation_rating(mitigation_rating, attacker);

                if (attacker->IsClient())
			attack_rating = (attacker->CastToClient()->CalcATK() + ((attacker->GetSTR()-66) * 0.9) + (attacker->GetSkill(SkillOffense)*1.345));
                else
                        attack_rating = (attacker->GetATK() + (attacker->GetSkill(SkillOffense)*1.345) + ((attacker->GetSTR()-66) * 0.9));

                attack_rating = attacker->mod_attack_rating(attack_rating, this);

		damage = GetMeleeMitDmg(attacker, damage, minhit, mitigation_rating, attack_rating);
__________________
Realtime auction logger: http://ahungry.com/eqauctions/
  #6  
Old 02-21-2014, 05:33 PM
fadetree fadetree is offline
Planar Protector


Join Date: Mar 2012
Posts: 1,958
Default

lol, haven't seen code with THAC0's in it for a while.
__________________
The Ancient Ranger
Awake again.
  #7  
Old 02-22-2014, 11:58 AM
myriverse myriverse is offline
Planar Protector

myriverse's Avatar

Join Date: Jan 2013
Location: Swamp of N.O. Hope
Posts: 2,469
Default

Skill does increase ATK, but it's not ATK that affects chance to hit.
__________________
Gnawlunzs Phrogphry
Master Angler, Baker, Cadger, Drunk
"If you can't eat a frog, then eat two."
  #8  
Old 02-24-2014, 09:36 AM
Mirana Mirana is offline
Kobold


Join Date: Nov 2010
Posts: 171
Default

So I'm at work Monday and just looking at all this code (I didn't look during the weekend, I was busy playing, duh).

I'm able to decipher bits and pieces of the code but it looks like there are variables that are referenced elsewhere in the code. It's like trying to read a book in Spanish when you only know half the language.

Does anyone know how floats work? Specifically these functions
float mit_roll = MakeRandomFloat(0, mit_rating);
float atk_roll = MakeRandomFloat(0, atk_rating);

MakeRandomFloat is some sort of function with the inputs of "0" and "mit_rating" or "atk_rating" which are calculated elsewhere. What does MakeRandomFloat do?

THAC0 stands for "To Hit AC 0" correct?
Last edited by Mirana; 02-24-2014 at 09:40 AM..
  #9  
Old 02-24-2014, 10:08 AM
imajester imajester is offline
Orc


Join Date: May 2010
Posts: 31
Default

Quote:
Originally Posted by Mirana [You must be logged in to view images. Log in or Register.]
So I'm at work Monday and just looking at all this code (I didn't look during the weekend, I was busy playing, duh).

I'm able to decipher bits and pieces of the code but it looks like there are variables that are referenced elsewhere in the code. It's like trying to read a book in Spanish when you only know half the language.

Does anyone know how floats work? Specifically these functions
float mit_roll = MakeRandomFloat(0, mit_rating);
float atk_roll = MakeRandomFloat(0, atk_rating);

MakeRandomFloat is some sort of function with the inputs of "0" and "mit_rating" or "atk_rating" which are calculated elsewhere. What does MakeRandomFloat do?

THAC0 stands for "To Hit AC 0" correct?
An 'int' is a Whole Number where a float is more like a Real Number, meaning a float has a fractional component to it. i.e. 3.14159 would be represented by a float, not an int.

MakeRandomFloat(a,b) will return a random value between a and b. MakeRandomFloat(0, 10) will return a random real number between 0 and 10.


You are correct on THAC0.
Last edited by imajester; 02-24-2014 at 10:10 AM..
  #10  
Old 02-24-2014, 10:38 AM
koros koros is offline
Planar Protector


Join Date: Mar 2011
Posts: 1,127
Default

Quote:
Originally Posted by Mirana [You must be logged in to view images. Log in or Register.]
So I'm at work Monday and just looking at all this code (I didn't look during the weekend, I was busy playing, duh).

I'm able to decipher bits and pieces of the code but it looks like there are variables that are referenced elsewhere in the code. It's like trying to read a book in Spanish when you only know half the language.

Does anyone know how floats work? Specifically these functions
float mit_roll = MakeRandomFloat(0, mit_rating);
float atk_roll = MakeRandomFloat(0, atk_rating);

MakeRandomFloat is some sort of function with the inputs of "0" and "mit_rating" or "atk_rating" which are calculated elsewhere. What does MakeRandomFloat do?

THAC0 stands for "To Hit AC 0" correct?
Float means floating point, i.e. it can handle any number of decimal places but takes more storage/computational time.

It's making a roll between 0 and the rating.
Closed Thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:57 AM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.