PDA

View Full Version : Archery!


Arroe
03-20-2003, 12:43 PM
i think archery is severely bugged. why am i hitting for 79dmg with a 175dmg bow?!?! anyone know how i can fix this? a link to a patch would be great! :)

mByte
03-26-2003, 06:14 PM
Dude!

Just be lucky its in there.

If you want to help make it better find some sort of Damage Table Algarythem or what not, im sure there is much more important work then fixing archery atm.

a 175dmg bow with a 11dmg arrow in eqlive you could hit for 79dmg. Its all the luck of the roll.

The only time you get a minimum damage in eqlive on a bow is with trueshot if im not mistaken.

So how do you know its not working right?

Anyways - Keep up the good work dev's. Always fun to play with the src after its released :)

TNT
03-30-2003, 03:55 AM
Ya know how he knows it's not working right mByte?

Because I'm pretty sure I know what he's talkin about... The bow will ONLY hit for 79 dmg (or 73, but I probly used a different type of arrow.) I've tested it with custom bows I made too, it seems like if you set a bows damage too high, it messes up the calculation of the data.

I made a bow that was 254 reg dmg, 254 magic dmg once and got non-stop crits for.... guess what, 13 dmg... LOL, so yeah, something is wrong, and I'm sure there are more important things that need fixed atm.

Anyway, maybe you could give him a better description on how he could help out fixing this problem on his own rather than a one-liner that really tells him nothing?

Ta-ta... TNT.

Roadkill
04-16-2003, 12:27 AM
Same here :( Made a 150 damage bow, and I've seen it hit for nothing but 2 or 4 ever (warrior using it). My skill is maxed, and I hit for 100s+ with the War Bow of Rallos Zek just fine. So it has something to do with going over a certain damage value.

Trumpcard
04-16-2003, 01:54 AM
Heres the code for it...

// This is a Ranged Weapon Attack / Bow
const Item_Struct* Rangeweapon = 0;
const Item_Struct* Ammo = 0;
Rangeweapon = database.GetItem(pp.inventory[11]);
Ammo = database.GetItem(pp.inventory[21]);

if (!Rangeweapon) {
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", pp.inventory[11]);
break;
}

if (!Ammo) {
Message(0, "Error: Ammo: GetItem(%i)==0, you have nothing to throw!", pp.inventory[11]);
break;
}

uint8 WDmg = Rangeweapon->common.damage;
uint8 ADmg = Ammo->common.damage;

// These dmg formulae were taken from all over the net.
//No-one knows but Verant. This should be fairly close -BoB
// ** ToDO: take into account trueshot disc (x2.0) and
// Archery Mastery AA when they are available.
// I am still looking for 'double' information too.
// Note: Rangers have a chance of crit dmg with a bow (affected by Dex)

uint8 levelBonus = (pp.STR+pp.level+GetSkill(ARCHERY)) / 100;
uint8 MaxDmg = (WDmg+ADmg)*levelBonus;

sint32 TotalDmg = 0;
sint32 critDmg = 0;

if(GetClass()==RANGER)
{
critDmg = (sint32)(MaxDmg * 1.72);
}

if (MaxDmg == 0)
MaxDmg = 1;

TotalDmg = 1 + rand()%MaxDmg;

// TODO: post 50 dmg bonus
// TODO: Tone down the PvP dmg
// borrowed this from attack.cpp
// chance to hit

float chancetohit = GetSkill(ARCHERY) / 3.75;
if (pp.level-target->GetLevel() < 0) {
chancetohit -= (float)((target->GetLevel()-pp.level)*(target->GetLevel()-pp.level))/4;
}

int16 targetagi = target->GetAGI();
int16 playerDex = (int16)(this->itembonuses->DEX + this->spellbonuses->DEX)/2;

targetagi = (targetagi <= 200) ? targetagi:targetagi + ((targetagi-200)/5);

chancetohit -= (float)targetagi*0.05;

chancetohit += playerDex;
chancetohit = (chancetohit > 0) ? chancetohit+30:30;
chancetohit = chancetohit > 95 ? 95 : chancetohit; /* cap to 95% */

// Hit?
if (((float)rand()/RAND_MAX)*100 > chancetohit)
{
this->Message(MT_Emote, "You missed your target");
target->CastToNPC()->Damage(this, 0, 0xffff, 0x07);
}
else
{
// no crits before level 12 cap is maxed
if((GetClass()==RANGER)&&(GetSkill(ARCHERY)>65)&&(rand()%255<(GetSkill(ARCHERY)+playerDex)/2)&&(chancetohit > 85))
{
this->Message(MT_Emote, "You score a critical hit!(%d)", critDmg);
target->CastToNPC()->Damage(this, critDmg, 0xffff, 0x07);
}
else
{
this->Message(MT_Emote, "You Hit for a total of %d non-melee damage.", TotalDmg);
target->CastToNPC()->Damage(this, TotalDmg, 0xffff, 0x07);
}



So, from this we see max damage is ..

uint8 WDmg = Rangeweapon->common.damage;
uint8 ADmg = Ammo->common.damage;
// These dmg formulae were taken from all over the net.
//No-one knows but Verant. This should be fairly close -BoB
// ** ToDO: take into account trueshot disc (x2.0) and
// Archery Mastery AA when they are available.
// I am still looking for 'double' information too.
// Note: Rangers have a chance of crit dmg with a bow (affected by Dex)

uint8 levelBonus = (pp.STR+pp.level+GetSkill(ARCHERY)) / 100;
uint8 MaxDmg = (WDmg+ADmg)*levelBonus;
sint32 TotalDmg = 0;
sint32 critDmg = 0;


So, max damage should for a 150 damage bow with dmg. 7 arrows,

(150+7) * lvlBonus, where levelbonus is STR+LEVEL+SKILL/100, so assume a Str of 100, level of 20, and skill of 100, and you get 220/100 = 2 by integer division, so max damage should be

157*2 = 314

Then

if (MaxDmg == 0)
MaxDmg = 1;
TotalDmg = 1 + rand()%MaxDmg;

so, damage done on a noncrit for a 150 damage weapon should be
between 1 and 315...

Why its not? My guess is theres an integer division going on screweing something up, or theres an int8 or 2 in there screwing up the calculation.

Trumpcard
04-16-2003, 02:07 AM
I think the problem is that its using uint8 for the data types.. uint8 is defined as an unsigned char ?

I think thats the problem, I'll up them to uint16 's , and I bet that will fix the problem...

kathgar
04-20-2003, 11:18 PM
uint8 is an unsigned char, since char is a byte long.. most of the time.. It was really fun when I was testing some things and couting uint8s.. and getting like

Graypaint
04-21-2003, 01:41 AM
the actual equation seems reasonable though.

a_Guest03
04-21-2003, 02:02 AM
Last night, killspree, Jeggred, and I were playing with archery equations. We tried using the basic melee formula with dexterity instead of strength. We found that the formula worked... kind of. The high values came out perfect. With a kickass bow, and great stats and skills, we came up with our expected damage outputs. But at level 20, with a 20 damage bow, we had people hitting for 58... I think that's a bit high.

Archery is next on my list to evaluate and adjust as necessary, unless I get really busy and decide to do an easier one, like tiger strike, or many of ones I suspect have similar equations to kick.

What I will need is example data from live to run my test equations against. I want to know DEX, skill, bow damage, and the highest hit received with those stat/skill/damage combinations. Killspree gave me a high value of 290 DEX, 240 skill, 43 damage bow, level 65 character. The result from the current equation gave an accurate measurement of what the maximum damage should be according to killspree's data.

Is damage really related to strength or is it dexterity? I would think it was related to Dex, skill, combined weapon damage, and maybe, just maybe strength.

I also tested the above equation with killspree's live data maximum, from the example above.
Live data suggested maximum: 370. Current equation maximum: 250.