Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2016, 03:32 PM
tigurius
Fire Beetle
 
Join Date: Sep 2004
Posts: 24
Default Mage Focus Makes Tiny Pets Fix

I finished my lower level mage focus item quests from Temple of Sol Ro to discover that the focus effect summons a laughably tiny pet. Although it was a cute lil guy i missed the beefy bigger pet from gaining the bonuses.

I took a dive into the source to figure out where it went wrong. I came down to the following line in zone/pets.cpp

Code:
npc_type->size = npc_type->size * (1 + (scale_power / 2)) > npc_type->size * 3 ? npc_type->size * 3 : 1 + (scale_power / 2);
Lets see how this evals:
npc_type->size = 4 (from SummonFireR9)
scale_power = .05 (evaluated from float scale_power = (float)act_power / 100.0f where act_power = +5 with the Torch of Alna effect (Minion of Fire)

So the formula evaluates to:
4 * (1 + (.05 /2)) > 4 * 3 = FALSE so 1 + (.05 /2) is the size to be used, which equals 1.025 - that would make a very small pet.

I believe there is possibly a missing "npc_type->size *" before the ( 1+ (scale_power / 2)). By adding this, it changes the formula to: 4 + (.05/2) = 5.25, a size that is bigger than the default 4 but by only 28% or so which makes sense.

So the line should be updated to say:
Code:
npc_type->size = npc_type->size * (1 + (scale_power / 2)) > npc_type->size * 3 ? npc_type->size * 3 : npc_type->size * (1 + (scale_power / 2)
I recompiled zone with this change and to my surprise my pet was now exactly the size it should be as focused. If I remove the torch, he's back down to size 4.

I am not sure what other repercussions have been introduced with this change but it did fix the mage pet focus issue for me.
Reply With Quote
  #2  
Old 03-01-2016, 03:57 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Pet focuses suck. They're horribly implemented on live. There really shouldn't be any code deciding on their stats at all, they really define a new NPC on live, which is what we should be doing :P

Proof: http://mysticallightfighters.com/ima...er/sodpets.jpg that's based on data given to a dev.
Reply With Quote
  #3  
Old 03-01-2016, 04:02 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by demonstar55 View Post
Pet focuses suck. They're horribly implemented on live. There really shouldn't be any code deciding on their stats at all, they really define a new NPC on live, which is what we should be doing :P

Proof: http://mysticallightfighters.com/ima...er/sodpets.jpg that's based on data given to a dev.
That's a pretty static way of implementing something though. Pros and cons to going that route.
Reply With Quote
  #4  
Old 03-01-2016, 04:26 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Quote:
Originally Posted by Akkadius View Post
That's a pretty static way of implementing something though. Pros and cons to going that route.
If there isn't a matching NPC for that focus it should use the default pet. That's how it works on live. (BST pets aren't focused until their level 64 pet despite the fact there are pet focuses that should be applied to them, well there is a pet power 15 and 25 that works on pre-64, but there are better pet focus that should work on pre-64 but don't)

The auto-scaling in code should not exist in a live-like environment.
Reply With Quote
  #5  
Old 03-01-2016, 04:27 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by demonstar55 View Post
If there isn't a matching NPC for that focus it should use the default pet. That's how it works on live. (BST pets aren't focused until their level 64 pet despite the fact there are pet focuses that should be applied to them, well there is a pet power 15 and 25 that works on pre-64, but there are better pet focus that should work on pre-64 but don't)

The auto-scaling in code should not exist in a live-like environment.
For sure I wasn't arguing against how live implements it, if that is how they do it obviously we would want to do something that matches it. But a ground-up approach, if I were working for SOE/DB and implementing something like that, doing a static entry for each pet focus is silly.
Reply With Quote
  #6  
Old 03-01-2016, 04:51 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Quote:
Originally Posted by Akkadius View Post
For sure I wasn't arguing against how live implements it, if that is how they do it obviously we would want to do something that matches it. But a ground-up approach, if I were working for SOE/DB and implementing something like that, doing a static entry for each pet focus is silly.
Yes it is, which is probably why that BST pet oddity exists XD


But yeah, I got all the low level mag focus items now ... just need to parse out their everything -.-
Reply With Quote
  #7  
Old 03-01-2016, 08:50 PM
tigurius
Fire Beetle
 
Join Date: Sep 2004
Posts: 24
Default

Looks like the present code is mostly emulating the really old trilogy rules where your pet gets a rank bump on focus. Thats fine for the lower level stuff which is where i'm playing now, but after reviewing that chart, it really needs a different approach like you said.

I haven't played live since Luclin so I have a hell of a lot of catching up all the rules since. I'd like to take a stab at some pet code later.
Reply With Quote
  #8  
Old 03-02-2016, 02:30 AM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

For now.. till a new system is made that line of code is working again.
Reply With Quote
  #9  
Old 03-02-2016, 01:57 PM
tigurius
Fire Beetle
 
Join Date: Sep 2004
Posts: 24
Default

I don't suppose there is a backlog built for pet code? Getting excited after reading:
http://www.eqmagetower.com/forums/viewtopic.php?t=2789

Do pets properly equip armor and haste/toy items? I see weapons work pretty good.
Reply With Quote
Reply


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 06:20 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3