NPC Damage Too low? Look inside (Updated 9/27/07)

A place where you can talk about anything Dawn of Light or DAOC related

Moderators: Project Admin, Support Team

NPC Damage Too low? Look inside (Updated 9/27/07)

Postby Krugus » Thu Sep 13, 2007 3:09 am

EDIT: I think I found it! You'll have to look down thread for the reply :)

Greetings,

I'm not a programmer but I do fiddle with code as a hobby (like modding UI's in various online games, modding Dungeon Siege code etc etc).

Ok with that out of the way. A few weeks back I started up my own server (thanks to the Dev's for all their hard work BTW!). Searching the site for answers. Find some answers here and there that covers the basics and all that but the one thing that was giving me grief was the NPC's dmg was waaay too low. After reading various posts on the subject, I started to fiddle with it myself.

Its not pretty but it does Scale with the mobs level and you can adjust it easy enough.

Ok in GameLiving.cs

Code: Select all
 public virtual double AttackDamage(InventoryItem weapon)
        {//Krugus - Start of dmg mod
            //original code:   double damage = (1.0 + Level / 3.7 + Level * Level / 175.0) * AttackSpeed(weapon) * 0.001;
            double damage = ((1.0 + Level * Level / 3.7 + Level * Level / 175.0) * AttackSpeed(weapon) * 0.001); //dmg goes up as the mob does
            if (weapon == null || weapon.Item_Type == Slot.RIGHTHAND || weapon.Item_Type == Slot.LEFTHAND || weapon.Item_Type == Slot.TWOHAND)
            {
                //Melee damage buff and debuff
                damage *= GetModified(eProperty.MeleeDamage) * 0.01;
            }
            else if (weapon.Item_Type == Slot.RANGED)
            {
                //Ranged damage buff and debuff
                damage *= GetModified(eProperty.RangedDamage) * 0.01;
            }//Krugus - the following is needed to adjust the dmg down to levels where the players can survive it.
             //also based on the mobs Level.  Easy to tweak:  You could adjust levels in ranges of 10 instead (which I might try out later)
            if (Level <=15) // lower level mobs get different adjustment so they wont kill players outright.
                return damage *(.50 - (Level *0.015));
            if (Level <= 32)// adjustments based on level ranges
             return damage *(.35 - (Level - 15)*.0125);
            if (Level <= 50)// adjustments based on level ranges
              return damage *(.15 - ((Level - 32) * 0.0025));
            if (Level <=60)// Needs Tweaking
             return damage *(.05 -((Level - 50) * 0.0035));
            if (Level >60) // Needs tweaking
            return damage * (.015 - ((Level - 60) * 0.0005));
            {
             return damage;
            }
        }

Quote and Code seems to cut part of my code off(DUH fixed it::mumbles to self about not checking the disable HTML in this post)

Anyways, as I said its not pretty but the mobs at the start hit for 4 to 8 and the mobs at 50th hit for 200 to 300 pts on my test Armsman in arcaniumPlate armor.

My Armsman could kill a npcs upto Yellow easy enough but the Orange ones would kill him ;)

This is the only dmg mod I have done to the DOL code for npc's. Its MUCH better than it was and yes it still needs tweaking (which I am in the process of still doing myself) but I wanted to give something back to the DOL community. I know its not much but its a start ;)
Last edited by Krugus on Thu Sep 27, 2007 8:39 pm, edited 3 times in total.
User avatar
Krugus
DOL Initiate
 
Posts: 22
Joined: Mon Sep 10, 2007 4:38 am
Location: Arkansas

Postby IStandAloneToo » Thu Sep 13, 2007 5:01 am

That's awesome! We will definitely take a look at this.

I've got a challenge for you. Pet's melee damage is PITIFUL. Can you come up with a way to scale that too!?

Good luck!
Ryan
Hi :)
IStandAloneToo
Developer
 
Posts: 1179
Joined: Sat Jul 14, 2007 2:26 am
Location: California

Postby Krugus » Thu Sep 13, 2007 7:13 am

As far as the pets go....This fixes them as well but just to be sure I made up a Cab and /player leveled:

@10th
Ruby Sim hit for 15 to 21pts vs mobs in Tomb of Mithra

@25th
Emerald Sim was hitting for 24 to 39pts the Goblins in Tepoks Mine

@50th
Jade Sim was hitting for 73 to 120pts vs Moorliches in Lyonesses

I do have player damage set at 1.5 on my server (don't think it effects pets but... I'll have to check

::EDIT::

Yes it does with the server set back at 1.0 for PvE dmg the Jade Sim was hitting for 51 to 80 pts (not counting the dmg add buff which adding 26 to 32pts a wack so it was doing anywhere from 77 to 112pts roughly with the dmg add buff going)

So the Pets do scale with level but the last pet for the Cablist is @32nd level so it seems the Jade Sim is locked at that level for dmg.

::EDIT::

Did abit more testing with the Jade Sim on my 50th lvl CablistBob:

vs 37th lvl mobs (green con) the pet was hitting for 73 to 115 pts (no dmg add)
vs 41st lvl mobs (blue con) the pet was hitting for 61 to 98 pts (no dmg add)
vs 50th lvl mobs (yellow con) the pet was hitting for 51 to 80 pts (no dmg add)
vs 53rd lvl mos (orange con) the pet was hitting for 44 to 73pts (no dmg add)
User avatar
Krugus
DOL Initiate
 
Posts: 22
Joined: Mon Sep 10, 2007 4:38 am
Location: Arkansas

Postby IStandAloneToo » Thu Sep 13, 2007 2:15 pm

Good job man. I know that on live the pets hit for quite a bit more than that. I thought they hit one yellow/orange mobs around 100-200.
Ryan
Hi :)
IStandAloneToo
Developer
 
Posts: 1179
Joined: Sat Jul 14, 2007 2:26 am
Location: California

Hrmm

Postby Krugus » Thu Sep 13, 2007 2:29 pm

Well like I said its not perfect but its a start.
"Stand back man! I have a Holy Avenger and I know how to use it! " ...quote from the unknown paladin.
User avatar
Krugus
DOL Initiate
 
Posts: 22
Joined: Mon Sep 10, 2007 4:38 am
Location: Arkansas

Postby Tolakram » Thu Sep 13, 2007 2:29 pm

And you know, for us theurgists, there isn't any code to increase tohit chance based on number of attackers. Unless someone snuck that in somewhere. ;)

I have no clue how one might guess what that number would be.
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Postby Krugus » Thu Sep 13, 2007 2:51 pm

Ok did a quest test before I run off to work.

Unbuffed Jade Sim hits for 100 to 160 pts vs a Moorlich. As soon as I buff it with the Dex/Qui buff its dmg drops to 50 to 80ish pts and I think I know why.

In the code also found in GameLiving.cs

Code: Select all
public virtual int AttackSpeed(params InventoryItem[] weapon)
      {
         //TODO needs to come from the DB
                        double speed = 3400 * (1.0 - (GetModified(eProperty.Quickness) - 60) / 500.0);
         //Combat Speed buff and debuff
         if (ActiveWeaponSlot == eActiveWeaponSlot.Distance)
         {
            speed *= GetModified(eProperty.ArcherySpeed) * 0.01;
         }
         else
         {
            speed *= GetModified(eProperty.MeleeSpeed) * 0.01;
         }

         return (int)speed;
      }


This here lowers mob dmg because they attack faster. If I change the 3400 to say 1000, Mobs attack once a second but they do pittful dmg even with my modded code in there (30th level mobs went from hitting for 50 to 60 pts but attack @ 3.4 secs vs 17 pts @ 1 sec)

So will require more tweaking.
"Stand back man! I have a Holy Avenger and I know how to use it! " ...quote from the unknown paladin.
User avatar
Krugus
DOL Initiate
 
Posts: 22
Joined: Mon Sep 10, 2007 4:38 am
Location: Arkansas

Postby IStandAloneToo » Thu Sep 13, 2007 2:59 pm

Good call. I played a Cab as my main on DAoC for 6 years and I never remember the quick buff degrading my pet's attack significantly if at all. Is it confirmed that quickness 'degrades' pet's attack damage and not just speed their swings up?
Ryan
Hi :)
IStandAloneToo
Developer
 
Posts: 1179
Joined: Sat Jul 14, 2007 2:26 am
Location: California

Postby Tolakram » Thu Sep 13, 2007 4:21 pm

I think degrading was one of those Myths. When attack speeds up the damage of each attack goes down in order for the DPS to remain the same.

Mythic Math.

ISAT, what server did you play on? I was on Galahad.
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Postby Troglart » Thu Sep 13, 2007 7:34 pm

tolakram wrote:ISAT, what server did you play on? I was on Galahad.

Unrelated but...

MUAHAHAHA 50 ANIMIST HIB GALAHAD I KILL YOU MUAHAHAHAHAHAHAHA.. but i havnt played live in quite a while
Yea im back again..
New website again.. http://troglart.mygamesonline.org
free hosts hurray.. lawl it would be funny to run a server off a free host
Troglart
DOL Follower
 
Posts: 460
Joined: Wed Oct 12, 2005 12:34 am

Postby Krugus » Sun Sep 16, 2007 6:57 pm

Ok I decided to rearrange my code abit.

As you can see I've decided to ajust it by every 5 levels past 9th then at 50th then its every 10 levels.

placed in GameLiving.cs

Code: Select all
public virtual double AttackDamage(InventoryItem weapon)
        {//Krugus - Start of dmg mod
            //original code:   double damage = (1.0 + Level / 3.7 + Level * Level / 175.0) * AttackSpeed(weapon) * 0.001;
            //Added back into the code the speed that was subtracted from the weapon speed to bring the dmg back up (testing).
            double damage = ((1.0 + Level * Level / 3.7 + Level * Level / 175.0) * AttackSpeed(weapon) * 0.001); 
            if (weapon == null || weapon.Item_Type == Slot.RIGHTHAND || weapon.Item_Type == Slot.LEFTHAND || weapon.Item_Type == Slot.TWOHAND)
            {
                //Melee damage buff and debuff
                damage *= GetModified(eProperty.MeleeDamage) * 0.01;
            }
            else if (weapon.Item_Type == Slot.RANGED)
            {
                //Ranged damage buff and debuff
                damage *= GetModified(eProperty.RangedDamage) * 0.01;
            }//Krugus - the following is needed to adjust the dmg down to levels where the players can survive it.
             //based on the mobs Level. Easy to tweak:  level range of 5 per lvl after 9th then 10 lvls per range after 49th
           if (Level <= 9) // Adjustments by levels of 10
               return damage * (.50 - (Level) * 0.015);//0-9th lvl
           if (Level <= 14) // Adjustments by levels of 10
               return damage * (.37 - (Level - 10) * 0.015);//10-14th lvl
           if (Level <= 19)// Adjustments by levels of 10
               return damage * (.32 - ((Level - 15) * 0.015));//15-19th
           if (Level <= 24) // Adjustments by levels of 10
               return damage * (.28 - (Level - 20) * 0.0125);//20-24th lvl
           if (Level <= 29)// Adjustments by levels of 10 
               return damage * (.24 - ((Level - 25) * 0.0125));//25-29th
           if (Level <= 34) // Adjustments by levels of 10
               return damage * (.20 - (Level - 30) * 0.0075);//30-34th lvl
           if (Level <= 39) // Adjustments by levels of 10 
               return damage * (.18 - ((Level - 35) * 0.0075));//35-39th
           if (Level <= 44) // Adjustments by levels of 10
               return damage * (.17 - (Level - 40) * 0.01);//40-44th lvl
           if (Level <= 49) // Adjustments by levels of 10 
               return damage * (.15 - ((Level - 45) * 0.01));//45-49th
           if (Level <= 59) // Adjustments by levels of 10. Needs Tweaking
               return damage *(.12 - (Level - 50)* 0.01);//50-59th
           if (Level <= 69)// Adjustments by levels of 10.  Needs Tweaking
               return damage *(.0355 - (Level - 60)* .002833);//60-69th
           if (Level > 69)// Adjustments by levels of 10.  Needs Tweaking
               return damage *(.015 - ((Level - 70)* 0.001));//70+
            {
             return damage;
            }
        }
      /// <summary>
      /// Max. Damage possible without style


As I said before its not perfect but its a start (and I'm still tweaking it).


OK with that out of the way....

As far as the Qui buffs go, yes it degrades the pets attack. Its very easy test. (non buffed pet vs buffed pet fighting same mob).

As I pointed out before this line in GameLiving.cs

Code: Select all
double speed = 3400 * (1.0 - (GetModified(eProperty.Quickness) - 60) / 500.0);


lowers the attack speed down so the attacks are faster but as you can see from this line in GameLiving.cs

Code: Select all
 {//Krugus - Start of dmg mod
            //original code:   double damage = (1.0 + Level / 3.7 + Level * Level / 175.0) * AttackSpeed(weapon) * 0.001;
            //Added back into the code the speed that was subtracted from the weapon speed to bring the dmg back up (testing).
            double damage = ((1.0 + Level * Level / 3.7 + Level * Level / 175.0) * AttackSpeed(weapon) * 0.001);


AttackSpeed(weapon) in this part of the code is what causes the damage to lower as you attack faster.

Should we pull an unmodified AttackSpeed(weapon) at this part of the code to allow Quickness buffs to not effect the damage output?
"Stand back man! I have a Holy Avenger and I know how to use it! " ...quote from the unknown paladin.
User avatar
Krugus
DOL Initiate
 
Posts: 22
Joined: Mon Sep 10, 2007 4:38 am
Location: Arkansas

Postby Dinberg » Sun Sep 16, 2007 7:39 pm

That sounds better, because otherwise by the same assumption a quickness/haste debuff will actually make someone hit for harder in melee, which is a bit of a problem!
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

UPDATE with Pet Damage fix (sorta)

Postby Krugus » Tue Sep 25, 2007 2:17 am

Ok just posting an Update.


Still not perfect but here is what I have so far:

GameLiving.cs

EDIT: Ugg hit the submit button by accident

Anyways!

GameLiving.cs
Code: Select all
/// <summary>
      /// Returns the Damage this Living does on an attack
      /// </summary>
      /// <param name="weapon">the weapon used for attack</param>
      /// <returns></returns>
        public virtual double AttackDamage(InventoryItem weapon)
        {//original code:   double damage = (1.0 + Level / 3.7 + Level * Level / 175.0) * AttackSpeed(weapon) * 0.001;
            double damage = ((((((((2.0 + Level) * Level) / 3.5) + Level) * Level) / 175.0) * AttackSpeed(weapon)) * 0.001) + Level*2.5;//Krugus - Tweaking DMG Output
            if (weapon == null || weapon.Item_Type == Slot.RIGHTHAND || weapon.Item_Type == Slot.LEFTHAND || weapon.Item_Type == Slot.TWOHAND)
            {
                //Melee damage buff and debuff
                damage *= GetModified(eProperty.MeleeDamage) * 0.01;
            }
            else if (weapon.Item_Type == Slot.RANGED)
            {
                //Ranged damage buff and debuff
                damage *= GetModified(eProperty.RangedDamage) * 0.01;
            }
            //Krugus - Below we adjust the dmg down so our players can survive it.  ATM It starts at the lowest level and is adjusted down .1 past the next tier.
            //This is so the next tier will hit just abit harder than the last.  The first tier is 0-9th then each tier is broken down into every 5 levels
            //till 50th then its adjusted back to every 10 levels.  Can be easily tweaked. 
            if (Level <= 9) //lvl0-9th
            {
                return damage * (2.0 - ((Level) * 0.1222));
            }
            if (Level <= 14) //lvl10-14th
            {
                return damage * (1.0 - ((Level - 10) * 0.09));
            }
            if (Level <= 19)//lvl15-19th
            {
                return damage * (.65 - ((Level - 15) * 0.04));
            }
            if (Level <= 24) //lvl20-24th
            {
                return damage * (.50 - ((Level - 20) * 0.0275));
            }
            if (Level <= 29)//lvl25-29th
            {
                return damage * (.40 - ((Level - 25) * 0.015));
            }
            if (Level <= 34)//lvl30-34th
            {
                return damage * (.35 - ((Level - 30) * 0.015));
            }
            if (Level <= 39) //lvl35-39th
            {
                return damage * (.30 - ((Level - 35) * 0.015));
            }
            if (Level <= 44)//lvl40-44th
            {
                return damage * (.25 - ((Level - 40) * 0.015));
            }
            if (Level <= 49)//lvl45-49th
            {
                return damage * (.20 - ((Level - 45) * 0.015));
            }
            if (Level <= 59) //lvl50-59th
            {
                return damage * (.15 - ((Level - 50) * 0.00388));
            }
            if (Level <= 69)//lvl60-69th
            {
                return damage * (.125 - ((Level - 60) * 0.00388));//needs tweaking
            }
            if (Level <= 79)//lvl70-79th
            {
                return damage * (.10 - ((Level - 70) * 0.00388));//needs tweaking
            }
            if (Level > 79)//lvl80-100th
            {
                return damage * (.075 - ((Level - 70) * 0.00125));//needs tweaking
            }
            return damage;
        }
      /// <summary>
      /// Max. Damage possible without style




Also I'm using this with the above to make pets do more damage:

GameLiving.cs

Code: Select all
            // apply total damage cap
            ad.UncappedDamage = ad.Damage;
            ad.Damage = Math.Min(ad.Damage, (int)(UnstyledDamageCap(weapon) * effectiveness));


//Krugus - Start of dmg mod for PETS (1+(level*.06) 
//By 17th x2dmg, by 34th x3 dmg, by 50th x4 assuming default Server Properties of 1.0

      if ((this is GameNPC && (this as GameNPC).Brain is ControlledNpc && this.Realm != 0) && target is GameNPC)
      ad.Damage = (int)((double)ad.Damage * (1+(Level*.06) * (ServerProperties.Properties.PVE_DAMAGE)));//PET PVE dmg mod
      if ((this is GameNPC && (this as GameNPC).Brain is ControlledNpc && this.Realm != 0) && target is GamePlayer)
      ad.Damage = (int)((double)ad.Damage * (1+(Level*.06) * (ServerProperties.Properties.PVP_DAMAGE)));//PET PVP dmg mod
               
//End of DMG mod for PETS


            if ((this is GamePlayer || (this is GameNPC && (this as GameNPC).Brain is IControlledBrain && this.Realm != 0)) && target is GamePlayer)
               ad.Damage = (int)((double)ad.Damage * ServerProperties.Properties.PVP_DAMAGE);
            else if ((this is GamePlayer || (this is GameNPC && (this as GameNPC).Brain is IControlledBrain && this.Realm != 0)) && target is GameNPC)
               ad.Damage = (int)((double)ad.Damage * ServerProperties.Properties.PVE_DAMAGE);

            ad.UncappedDamage = ad.Damage;

            // patch to missed when 0 damage



Its still a work in progress. I'll have to reopen my DAoC account soon and get my Master Armorer Paladin out and do some testing! RAWR!
"Stand back man! I have a Holy Avenger and I know how to use it! " ...quote from the unknown paladin.
User avatar
Krugus
DOL Initiate
 
Posts: 22
Joined: Mon Sep 10, 2007 4:38 am
Location: Arkansas

Postby IStandAloneToo » Tue Sep 25, 2007 2:32 am

Nice. Would be nice to see all that if stuff inside a switch statement. Like:
Code: Select all
//levels 1-4
case 1:
case 2:
case 3:
case 4:
//do damage stuff here
break;
Ryan
Hi :)
IStandAloneToo
Developer
 
Posts: 1179
Joined: Sat Jul 14, 2007 2:26 am
Location: California

Postby Krugus » Tue Sep 25, 2007 2:45 am

IStandAloneToo wrote:Nice. Would be nice to see all that if stuff inside a switch statement. Like:
Code: Select all
//levels 1-4
case 1:
case 2:
case 3:
case 4:
//do damage stuff here
break;


I agree! As soon as I figure out how to do it :lol:

As I said, I'm not a programmer. I muck around with code.....sorta like "hrmm what does this button do?" kind of mucking. As I "muck" around with it I learn more and more. I've seen those statements in the code so I'll have a look at what I can figure out :wink:
"Stand back man! I have a Holy Avenger and I know how to use it! " ...quote from the unknown paladin.
User avatar
Krugus
DOL Initiate
 
Posts: 22
Joined: Mon Sep 10, 2007 4:38 am
Location: Arkansas


Return to “%s” General

Who is online

Users browsing this forum: No registered users and 1 guest