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 04-20-2015, 02:56 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default Externded Duration bugs

I continue to battle with the function Client::SendBuffDurationPacket.

My previous skirmish had to do with the shielding line of hp spells (minor, lesser, and shielding). If a focus item like Bear-hide boots was worn, the max HP would get all messed up when the server sent the SpellBuffFade struct up to increase the duration.

I found that the 'effect' field seems to be unknown. They were setting that to level (I guess they thought effective level was the correct value). I experimented with a bunch of theories, but only setting it to 255 got rid of the problem (which obviously sucks, since we still dont know whats going on).

Now, with the necro spell Allure of Death (and some others), the SpellBuffFade struct is sent up when wearing the boots again, and bam, the # of HP the GUI starts deducting is insanely high, causing the character to lose like 200 hp and then the server fixes it. That loop continues, but based on HP values the client can go unconscious, recover, etc based on these bad values. If I comment out the call to fix the duration, the spell works correctly, but not for the correct length.

Anyone have any ideas on how we can better update the spell duration without hosing up some spells, or what the effect field should be set to? Perhaps one of the unknown fields plays a role?

Here's the existing function. Again, the 255 was me, fixing the shielding line.

Quote:
void Client::SendBuffDurationPacket(Buffs_Struct &buff)
{
EQApplicationPacket* outapp;
outapp = new EQApplicationPacket(OP_Buff, sizeof(SpellBuffFade_Struct));
SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*) outapp->pBuffer;

sbf->entityid = GetID();
sbf->slot = 2;
sbf->spellid = buff.spellid;
sbf->slotid = 0;
sbf->effect = 255;
sbf->level = buff.casterlevel > 0 ? buff.casterlevel : GetLevel();
sbf->bufffade = 0;
sbf->duration = buff.ticsremaining;
sbf->num_hits = buff.numhits;
FastQueuePacket(&outapp);
}
Reply With Quote
  #2  
Old 04-20-2015, 05:06 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

AGAIN - This only happens when a focus item like Bear-hide boots are in effect and we use SendBuffDuration() to update the duration...

I decided to test effect as if it were a bitfield and drop a bit, test, drop a bit test..

What I found was that for the shielding line of spells, the effect field's bottom 6 bits contained an addition to max HP. So 32, 16, 8, 4, 2 and 1 changed max HP by those amounts (above and beyond the original spell). That's obviously not what we want to do when we update Buff Duration.

Setting effect to 0 cancelled the effect entirely. Setting any bits higher than 32 seemed to work (meaning, did not alter the spell effect). Maybe because the GUI rejects values that high or one of those bits being set means not to mess with the effect. So 64, 65, 128, 129, things like that had no impact on the max HP (left the value correct, while still fixing the Duration) which is what we want. Its hard to say if those upper 2 bits are a flag or simply make the value too large and the GUI rejects it.



The fix (for the shielding line) would be to set effect to 128 or 64. Trying to set it to the value of HP gained just ADDS that on top of the existing buff.

Now, for the Allure of Death, which converts HP to mana...

Setting effect to 128 resulted in the loss of 68hp per tick, 64 resulted in 30hp per tick, 32 resulted in 10 per tick, 16 resulted in 1 per tick, values 8, 4 and 2 actually resulted in POSITIVE HP per tick (from the GUI) and a value of 1 cancelled the effect as did 0.

I can't see a logical pattern to this. However, by setting the effect to 16 we only see a -1 HP per tick and the server side will do the right thing and push the correct HP updates as always.

Results of both shielding spell like and allure of death using various values for effect in the BuffFade_Struct:



At first glance setting effect to 0 in both cases seems nice, as the server will update HP regardless, but 0 makes the GUI drop max HP in the case of the shielding line and change color of max hp in the allure of death spell.

I'm planning a patch that will have a switch statement based on spellid, with a default value for effect of caster_level (which was what was there before my 1st patch). For spells we know that this breaks, I will use values that I found above. If you guys see a better solution, I'm all ears.
Reply With Quote
  #3  
Old 04-20-2015, 05:18 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Dark Pact also needs the change, so that seems to be a "line" of spells just like the shielding line.
Reply With Quote
  #4  
Old 04-21-2015, 10:36 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Ok. Any spell that uses SE_TotalHP when updated by SendBuffDuration is going to break if effect is < 64. I'm not sure why, but an effect of 128 or 64 and the GUI leaves it alone. so the MaxHP is left alone on the client and matches the server.

Any spell that uses SE_CurrentHP (as a buff) when updated by SendBuffDuration is going to break the gui if the effect does not match the base value. It was confusing for awhile, becausde even with SendHPUpdate turnedd off, the GUI was still doing normal resting ticks and it was hard to see. When effect is set to the base value, SendBuffDuration no longer messes up the GUIs HP value. The two do update separately, so a DOT could get subtracted twice then fixed, but no worse than that. I suppose we could also just send (1) if sending the correct value is too painful (which it might be for high level dots - causing the char to go unconcious and then recover) but this bug only applies to SendBuffDuration and AA of focus changes.

Fix ready to submit after my curent pull request is cleared up. This may get rid of some weird HP bouncing problems.
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 04:52 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