Thread: SoF support
View Single Post
  #15  
Old 03-09-2009, 12:29 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

BTW, the new buff encode and decode have been added to the SVN. They still aren't working for duration just yet, but we are still looking into why. The buff duration is a really odd issue that I just can understand yet.

Here are some notes about what we have seen or theorized about so far:

1. we have considered that maybe character level is being seen properly by the client as far as buffs are concerned. The reason for thinking this is that it seems that the duration formulas are yielding odd results for what the client shows for the buff duration. So far, all spells that use duration formula 11 (defined in the spells file/table) have a duration of 9 minutes in SoF. I think formula 10 may also have 9 minutes duration. Then, I think it is formulas 8 and 9 that both have a duration of 1 minute. All other formulas seem to have 0 duration when the buff is cast. I think if we knew what the actual formula is (it may be in the source code somewhere I am not seeing), we could figure out what would cause those durations for those formula types. Once we know what would cause it, we could probably find the solution easier.

2. If you zone while a buff icon is still on you, after zoning, it will show the correct duration. Buffs are set in the player profile while zoning, so that is handled differently than buffing without zoning.

3. If you cast a spell that buffs with a 0 duration, and then cast it again before the icon fades (using #cast), the buff will show up like normal and last for the normal duration. Not quite sure yet why this happens, but it may help to figure out what the cause of the 0 duration is.

4. Oddly, sometimes buffs seem to just work fine for an unknown reason, and then just stop working again. I think this one may be the most important thing to look at. So far, the only explaination I could figure out as to the cause of this is the sequence field in the OP_Action and OP_Damage related structures. Oddly enough, this field is not understood in Titanium, but Titanium knows that the sequence field for Action and Damage both need to match. It sets this field by getting the client's heading and then multiplying that by 2. Don't ask me why! After looking at the packets from Live, it appears that the sequence field is actually a float. So, I set it as a float in the SoF structs. I then tried logging in and casting buffs, then rotating slightly and casting them again. Eventually, I got to a heading that allowed me to buff most buffs and show the correct duration for them. Though, the ones with duration 8, 9, 10 and 11 still showed the 9 minute or 1 minute durations like they were showing before. Next, I turned a bit more to change my heading and was no longer able to get buffs to stick. This makes me think that we need to understand exactly what that sequence field is supposed to be sending, or at least a way to trick it. I tried forcing it to examples I was seeing from Live, but that didn't work at all. Live seems to use the same value in the sequence field for all buffs done in a zone. If you relog or zone again, I think that it changes slightly. Some of the observed values I saw from live were floats of 87.75 and 66.75. More testing is probably required.

In summary, buff duration is still in the works. I am sure we will figure it out eventually. This just seems odd. I haven't found any evidence that blocked buffs has anything to do with this. I imagine blocked buffs are all handled server-side anyway.

EDIT: Just found buff duration formulas. Now to see what would cause the durations we have seen so far:

Code:
int CalcBuffDuration_formula(int level, int formula, int duration)
{
	int i;	// temp variable

	switch(formula)
	{
		case 0:	// not a buff
			return 0;

		case 1:	// solar: 2/7/04
			i = (int)ceil(level / 2.0f);
			return i < duration ? (i < 1 ? 1 : i) : duration;

		case 2:	// solar: 2/7/04
			i = (int)ceil(duration / 5.0f * 3);
			return i < duration ? (i < 1 ? 1 : i) : duration;

		case 3:	// solar: 2/7/04
			i = level * 30;
			return i < duration ? (i < 1 ? 1 : i) : duration;

		case 4:	// only used by 'LowerElement'
			return ((duration != 0) ? duration : 50);

		case 5:	// solar: 2/7/04
			i = duration;
			return i < 3 ? (i < 1 ? 1 : i) : 3;

		case 6:	// solar: 2/7/04
			i = (int)ceil(level / 2.0f);
			return i < duration ? (i < 1 ? 1 : i) : duration;

		case 7:	// solar: 2/7/04
			i = level;
			return (duration == 0) ? (i < 1 ? 1 : i) : duration;

		case 8:	// solar: 2/7/04
			i = level + 10;
			return i < duration ? (i < 1 ? 1 : i) : duration;

		case 9:	// solar: 2/7/04
			i = level * 2 + 10;
			return i < duration ? (i < 1 ? 1 : i) : duration;

		case 10:	// solar: 2/7/04
			i = level * 3 + 10;
			return i < duration ? (i < 1 ? 1 : i) : duration;

		case 11:	// solar: confirmed 2/7/04
			return duration;

		case 12:	// solar: 2/7/04
			return duration;

		case 50:	// solar: lucy says this is unlimited?
			return 72000;	// 5 days

		case 3600:
			return duration ? duration : 3600;

		default:
			LogFile->write(EQEMuLog::Debug, "CalcBuffDuration_formula: unknown formula %d", formula);
			return 0;
	}
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 03-09-2009 at 08:35 AM..
Reply With Quote