EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Mage Focus Makes Tiny Pets Fix (https://www.eqemulator.org/forums/showthread.php?t=40433)

tigurius 03-01-2016 03:32 PM

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.

demonstar55 03-01-2016 03:57 PM

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.

Akkadius 03-01-2016 04:02 PM

Quote:

Originally Posted by demonstar55 (Post 247429)
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.

demonstar55 03-01-2016 04:26 PM

Quote:

Originally Posted by Akkadius (Post 247430)
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.

Akkadius 03-01-2016 04:27 PM

Quote:

Originally Posted by demonstar55 (Post 247432)
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.

demonstar55 03-01-2016 04:51 PM

Quote:

Originally Posted by Akkadius (Post 247433)
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 -.-

tigurius 03-01-2016 08:50 PM

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.

NatedogEZ 03-02-2016 02:30 AM

For now.. till a new system is made that line of code is working again.

tigurius 03-02-2016 01:57 PM

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.


All times are GMT -4. The time now is 10:01 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.