Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #16  
Old 09-24-2015, 05:49 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

Thanks Uleat.

I understand the concept but the vocab is still a little beyond me.

I figured to add to this thread with a different snippet since the same question applies. It appears to work with 12 > SkillMeditate > 0 in game.

Both #showstats and watching ticks are accurate although client mana# jumps around. Not sure when it normalizes but, a level 50 at max meditate (235) shows the ticks perfectly for a titanium client.

Does this look right/could it be better?

Comments within the code below:
Code:
int32 Client::CalcBaseManaRegen()
{
	uint8 clevel = GetLevel();
	int32 regen = 0;
	if (IsSitting() || (GetHorseId() != 0)) {
		if (HasSkill(SkillMeditate) && GetSkill(SkillMeditate) > 11) { // added GetSkill(SkillMeditate) > 11 so obtaining meditate isn't an immediate detriment at low levels
			regen = ((GetSkill(SkillMeditate) / 12)) + 1; // changed equation
		}
		else {
			regen = 2;
		}
	}
	else {
		regen = 1; // changed to 1 from 2
	}
	return regen;
}

int32 Client::CalcManaRegen()
{
	uint8 clevel = GetLevel();
	int32 regen = 0;
	//this should be changed so we dont med while camping, etc...
	if (IsSitting() || (GetHorseId() != 0)) {
		BuffFadeBySitModifier();
		if (HasSkill(SkillMeditate) && GetSkill(SkillMeditate) > 11) { // added GetSkill(SkillMeditate) > 11 so obtaining meditate isn't an immediate detriment at low levels
			regen = ((GetSkill(SkillMeditate) / 12)) + 1;  // changed equation
			regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
			CheckIncreaseSkill(SkillMeditate, nullptr, -5);
		}
		else {
			regen = 2 + spellbonuses.ManaRegen + itembonuses.ManaRegen;
		}
	}
	else {
		this->medding = false;
		regen = 1 + spellbonuses.ManaRegen + itembonuses.ManaRegen; // changed to 1 from 2
	}
	//AAs
	regen += aabonuses.ManaRegen;
	return (regen * RuleI(Character, ManaRegenMultiplier) / 100);
}
I'm open to all critique.

Thanks
Reply With Quote
  #17  
Old 09-24-2015, 07:50 AM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

I mean is this new formula another guestimation? Since the client has its own idea of regen we should be able to pull the math from there I would think..
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
  #18  
Old 09-24-2015, 08:17 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

I have noticed client mana# jumping around on my titanium client for quite some time. I did not take note of it until a few months ago. This occurred at times on live when I played but, probably for different reasons. I never thought much of it.

Prior to making this change, I had changed rule_values regarding mana regen. I noticed mana regen was +2 standing and this was introduced well after classic and possibly after Titanium was relesed, I don't recall. I wanted to fix this so, I changed the rule_values associated with mana regen. This change was not perfect. I knew I would need to alter the source at some point to actually fix it the way I wanted.

As far as guestimating a new formula: This is partially why I posted this. If there is a more accurate formula for mana regen that was in use from classic to OoW or around there, I'd like to hear it.

I played the most on live between SoL and DoN and I do not recall standing mana regen giving +2. In addition, I recall mana regen as a linear function of the meditate skill and never dependant on caster level during the time I played the most. I could be mistaken as I had no reason to actually create a formula.

PS. Your sarcasm is not lost on me
Reply With Quote
  #19  
Old 09-24-2015, 08:39 AM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

Wasn't sarcasm honestly, I just think if you want things to work the client and server have to be matching on the functions. I know in the past we had some concerns that our timing of the regen packets and the frequency were possibly a problem.
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
  #20  
Old 09-24-2015, 08:50 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

False assumption.

There seems to be quite a few differences between clients. Titanium and others? having certain things hardcoded making customization more difficult.

P99 codes for the same client and I have noticed a little mana# jumping there, as well. Again, I never thought of it much because "on tick" was the real amount, if off by a couple.

This is very noticeable when medding for longer periods and watching HP regen. I'm sure many know what I am talking about.

I'm curious to know how both of these, hp and mana, if different between client/server, could be detrimental.
EDIT: hp and mana regen

Thanks
Reply With Quote
  #21  
Old 09-24-2015, 08:56 AM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

Using HP for example while sitting down, it seems the client gets its update and then tries to make another jump just a few second after which then the server corrects back downward. Client is also trying to give 6 hp per tick more than the server wants to in this scenario.

__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
  #22  
Old 09-24-2015, 08:59 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

Aye, this is what I noticed with mana regen but maybe the other way around. The client says +1 because it's titanium, and the server says, nu-uh +2 and adds 1. I was getting 1+1 mana regen on most ticks (always 2 per full tick).

This was the main reason for my fix. I figured to learn a bit and change manaregen to something I thought was more classic-y.
Reply With Quote
  #23  
Old 09-24-2015, 09:04 AM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

yea id like to see it fixed also. Plus the scenario in which people fall unconscious before they lose all their HP... if you get hit serious enough you fall over for a moment until for whatever reason it lets you back up as if nothing happened.
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
  #24  
Old 09-24-2015, 09:12 AM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

That stopped happening to me after I recompiled on 7/29/15 and changed some rules. Unsure what it was exactly.

Before that, I would have very brief "double hits".

Check out post #3 - 7 in the thread below. Unsure if it will work for you or if you have done this but, I was very pleased it went away.

http://www.eqemulator.org/forums/showthread.php?t=39907
Reply With Quote
  #25  
Old 09-24-2015, 11:15 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

FYI, the HP and Mana jumping forward and then back to what it's supposed to be while regenerating? Happened on Live, too. For yeeeeears. Wouldn't be surprised if it still does.
Reply With Quote
  #26  
Old 09-24-2015, 12:26 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Character:SoDClientUseSoDHPManaEnd, perchance?

That doesn't solve the entire issue..but, it may have been a rule you changed.


I know that item scaling/stats is also an issue with some clients..but, I think demonstar55 did some work to fix that, or at least alleviate some of the problem.

When the client tries to calculate regen bonuses based on item stats, they really need to be inline with what the client expects..not what the server is necessarily using.

There's still a lot of tweaking that needs to be done in this area.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #27  
Old 09-24-2015, 12:35 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

Quote:
Character:SoDClientUseSoDHPManaEnd, perchance?
That was the last thing I did before it went away, changed the rule to false.

Quote:
When the client tries to calculate regen bonuses based on item stats, they really need to be inline with what the client expects..not what the server is necessarily using.
I don't foresee it affecting me but, does this mean changing <Character:HPRegenMultiplier> or similar is not the best idea?
Reply With Quote
  #28  
Old 09-26-2015, 12:30 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

I'm trying to replace the `CheckIncreaseSkill` equation in `zone\client.cpp( ~2268 )`. After a bit of testing, I found something that will only require changing one line. I don't like the coefficients for some skills. The solution I found mitigates a bit of my distaste for them.

To be replaced:

Code:
int32 Chance = 10 + chancemodi + ((252 - skillval) / 20);
I would like some assistance with properly writing the new equation. Below is my attempt to describe it:

Quote:
I had to graph this as a function of x - f(x) - otherwise I would have done it differently.
Instead of y = x^3 it needed to be x = y^3, I think. It's been many years since I've done any of this.

c = chancemodi
x = skillval

This is directly from the graphing program: (-root(3, 9.61x)1.5 + 22)

The best I can do to write it out: <-root(3, ((|15 + c|^1.1) * 0.4 + 1.75) * x ) * 1.5 + 22 + (2c/3)>

The parts <(-root(3,>, <(|15 + c|^1.1)> I do not know how to write out in C++
This is as far as I got:

Code:
int32 Chance = 22 + (chancemodi * 1.5) + 1.5 * (-root (3, (((abs(15 + chancemodi))^1.1 * 0.4 + 1.75) * skillval)))

or

int32 Chance = 22 + (chancemodi * 1.5) + 1.5 * (-cube root of (((abs(15 + chancemodi))^1.1) * 0.4 + 1.75) * skillval))
If you are interested in seeing it graphed with a few comparisons to current skill increase rates:

http://prntscr.com/8kpm36
Reply With Quote
  #29  
Old 09-26-2015, 05:34 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

C'mon you programming wizards! With all the traffic today I can't imagine noone can throw me a bone!

Please tell me how to write - (cube root), absolute value and x^n in C++.
Reply With Quote
  #30  
Old 09-26-2015, 06:58 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

A good place to start: http://www.cplusplus.com/reference/cmath/

Code:
cbrt(x)
abs(x)
pow(x, e)
__________________
Uleat of Bertoxxulous

Compilin' Dirty
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 02:46 PM.


 

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