Stamina regen rate

Archive of posts related to former distro versions. Be aware that posts here do not refer to the current distro and may not work.

Moderators: POL Developer, Distro Developer

Locked
Yukiko
Distro Developer
Posts: 2511
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Stamina regen rate

Post by Yukiko » Fri Sep 11, 2009 4:17 am

I searched the forums for anything relating to this and found an unreplied to (orphaned?) post dating back to 2007 asking why stamina wasn't regenerating. That was for Core 0.97.

I am using 0.98 and stamina does regenerate but very very slowly. I play4ed around with the cfg files in the attributes package that are supposed to allow changes to the rate but to no success. Can someone please tell me how I can get stamina to regen faster? My player (non-GM) character regenerates at about one point per five minute interval. I am using Core and Distro 0.98. I can only think it must be something I am doing wrong because no one has reported this before.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: Stamina regen rate

Post by Pierce » Fri Sep 11, 2009 6:55 am

That's depending on your script base. You should take a look into vitals.cfg which normally contains the RegenRateFunction link to the exported function which handles the regeneration.
There you could take a look how your script base handles the regeneration.
Or take a look how meditation handles the faster value for mana.

We have a normal regen value of 1200 (which is 12 per min.) for all vitals handled by a cprop on the mob and the regen/vital hook. Raising the cprop value e.g. by meditation leads to a higher rate.

I don't know if i have the actual distro for 98, but perhaps it's not changed yet:

vitalInit.src

Code: Select all

exported function GetStaminaRegenRate(mobile)
	var base_regen := CInt(AP_GetSettingsCfgElem("Regen").Stamina) * 100;

	return base_regen + AP_GetVitalRegenRateMod(mobile, "stamina");
endfunction
changed that for a test to:

Code: Select all

exported function GetStaminaRegenRate(mobile)
	var base_regen := CInt(AP_GetSettingsCfgElem("Regen").Stamina) * 100;

	return 4000;
endfunction
You should get a very fast stamina regeneration. I hope so ;)

Yukiko
Distro Developer
Posts: 2511
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Stamina regen rate

Post by Yukiko » Fri Sep 11, 2009 3:06 pm

Thanks but the point was, and I mentioned this, I am using POL Distro 0.98.

I can't understand why this hasn't been posted as a bug/problem/issue before. It might not be a bug/problem but to me it is an issue given the regen rate was so slow. I mean one point per five minute interval?

Oh well, I'll futs around with the stamina regen init function and see if I can get a reasonable regen rate.

Just curious, did anyone notice slow regen rates on the "Official POL Distro" server that Maud had running? I think you have to be using a non-GM character to really feel the effect of this.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Yukiko
Distro Developer
Posts: 2511
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Stamina regen rate

Post by Yukiko » Fri Sep 11, 2009 4:53 pm

OK I added a Broadcast line to the vitalInit.src file to send me the "Stamina Base Regen Rate" and the "Stamina Regen Rate Mod" values. Here is what I am getting.

Code: Select all

Stamina Base Regen Rate = 2500. Stamina Regen Rate Mod = -2464
The 2500 value for Base Regen looks right because the Settings.cfg file has that set to 25 and 25 * 100 = 2500. What I don't understand is why would a new character have a negative Stamina Regen Rate Mod? And why so high?

Is there something I am missing or not understanding here?
Again, just to refresh, I am using POL 0.98 Distro straight from the SVN. I have made no mods to the Attributes/Vitals scripts except for the one mentioned.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Yukiko
Distro Developer
Posts: 2511
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Stamina regen rate

Post by Yukiko » Fri Sep 11, 2009 8:32 pm

The negative "mod" value is coming from the focusControl script. I commented the two of them out (SE and AoS) and now the regen mod value is zero. So, without going to UOStratics, I assume Focus skill has something to do with stamina.

Might be a good idea to explain the oddities of some of the rather esoteric skills in a comment inside the skill's src file.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Tomi
POL Developer
Posts: 475
Joined: Tue Feb 21, 2006 5:08 pm

Re: Stamina regen rate

Post by Tomi » Sat Sep 12, 2009 1:43 am

its true focus skill affect the mana and stamina regen rates but... There should never be a negative value :D just a positive, so the focuscontrol script should be changed to check that the mod can not be negative.

Yukiko
Distro Developer
Posts: 2511
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Stamina regen rate

Post by Yukiko » Sat Sep 12, 2009 3:04 am

Tomi, the total regen rate is not negative. What I was getting was a positive "base regen rate" of 2500 but the "regen rate modifier" was a negative value of -2500. Thus when the two were added together on a new character with zero focus they were canceling out to a zero regen rate. This negative value decreased as focus was gained but of course the resulting positive regen rate was extremely low. Something on the order of 36 for a focus of 0.3. Which regenerates stamina very slowly.

The thing that I can see happening is that players won't be able to carry much or do much running until their focus gains to some value above 20 maybe. Don't you think this might discourage players? For me it's no big deal because on my shard I probably won't use focus in the way it is on EA/OSI but, assuming the Distro gets completed and someone sets it up. Then has people log-in and be unable to even carry ten logs and a saw because their stamina drops and takes five minutes per POINT to regenerate might cause some of them to be a tiny bit upset.

I am not good at thinking up clever formulas for stuff like this but maybe Austin or Maud or you can think of a way to make this a bit more balanced. I mean doesn't five minutes per stamina point regen sound rather slow to you?
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: Stamina regen rate

Post by Pierce » Sat Sep 12, 2009 5:18 am

// For every 1 points focus, +0.01 stamina per second
var stam_regen := focus / 100.0;

// For every 2 points focus, +0.01 mana per second
var mana_regen := focus / 200.0;

// We're not changing the base regen rate, only applying a MOD
// So subtract the configured base regen rate for mana and we get the mod total.
if ( base_stam_regen )
stam_regen -= (base_stam_regen / 60.0);
endif

if ( base_mana_regen )
mana_regen -= (base_mana_regen / 60.0);
endif

// Regen rates are in hundredths of points per minute
AP_SetVitalRegenRateMod(mobile, "Stamina", stam_regen * 60 * 100);
AP_SetVitalRegenRateMod(mobile, "Mana", mana_regen * 60 * 100);
With this formula it is not astonishing that the mod value is negative :D

Imho the following formula would be much easier because only the Mod is changed.

Code: Select all

		var stam_regen := focus * 10.0;
		var mana_regen := focus * 5.0;
		
		AP_SetVitalRegenRateMod(mobile, "Stamina", stam_regen);
		AP_SetVitalRegenRateMod(mobile, "Mana", mana_regen);

To put it in words. If you have a focus skill of 100, you get 1000 mod points for stamina and 500 for mana which means 10 more stamina (5 mana) regeneration per minute.
Easy to change/customize value for every shard.

User avatar
MuadDib
POL Expert
Posts: 1087
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Re: Stamina regen rate

Post by MuadDib » Sat Sep 12, 2009 7:03 am

Correct. The base should never be modified below itself by the Focus skill. It is a bonus to the regen, so should not decrease it at all. Purely a bonus.
POL Developer - The Penguin Scripter

Yukiko
Distro Developer
Posts: 2511
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Stamina regen rate

Post by Yukiko » Sun Sep 13, 2009 1:07 am

Ah then there is an error in the way the focus skill was working.

I was hoping it was a bug. I am curious though why this wasn't noticed before. I guess I can figure that out from my own actions though. No one, including myself, has used Distro version 0.98 except to maybe log-in to check a few things and that only as the default Admin.

People really should look at the Distro. I apologize to MaudDib, Austin and all the others who have worked on it for not looking more closely at it earlier. There are some very nice improvements such as the crafting gump/system. I haven't looked at that very much yet but one of my sons has and he told me it is a vast improvement over systems he has seen in the past.

Let's try to get it finished so it is feature complete and then it can be play-tested and debugged.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Locked