Pet mana regen

This is where you can make suggestions or report bugs that you've found
Locked
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

Pet mana regen

Post by dprantl »

Is extremely slow for all pets now. Even if they have 100 med, their mana regen rate is like 1 point per 10 seconds or something really slow like that.

Archived topic from AOV, old topic ID:1101, old post ID:7218
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Pet mana regen

Post by Red Squirrel »

This is so messed, all these random mana issues. The only thing thats been touched is items, and pets don't use items. I'll try to figure it out, but I have no clue where the start, since I went over the code a million times.

Archived topic from AOV, old topic ID:1101, old post ID:7220
Honk if you love Jesus, text if you want to meet Him!
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

Pet mana regen

Post by dprantl »

This seems to be affecting stamina regen too. It may be happening on all mobs as well, not just pets...

Archived topic from AOV, old topic ID:1101, old post ID:7245
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Pet mana regen

Post by Red Squirrel »

Which mob types exactly? All my tests show that they're regening mana very fast (mobs regen faster then players). And for the players having issues, what gender, race, and what skills?

These mana issues are mind boggling, since everything works fine for all tests that I do.

Archived topic from AOV, old topic ID:1101, old post ID:7250
Honk if you love Jesus, text if you want to meet Him!
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

Pet mana regen

Post by dprantl »

Ok, I just went to compassion with my dread tamer and had a wild holy squirrel dump its mana on me. It now has like 2 / 355 mana and it's going up so slow it completely stopped its casting... I'm still there right now if you want to check it out.

Archived topic from AOV, old topic ID:1101, old post ID:7256
User avatar
Hrnac
Posts: 77
Joined: Thu Aug 09, 2007 9:42 pm

Pet mana regen

Post by Hrnac »

Char mana regen is still super slow as well.

-Hrnac

Archived topic from AOV, old topic ID:1101, old post ID:7257
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Pet mana regen

Post by Red Squirrel »

Yeah this makes no sense at all, its working on test shard but not on live. This will be VERY hard to track down. I can rule out any script related things, as the live server is 100% duplicated from TC1 as of last night. So its some kind of timing issue on the server, clock cycles are slower or something.

Archived topic from AOV, old topic ID:1101, old post ID:7258
Honk if you love Jesus, text if you want to meet Him!
User avatar
Hrnac
Posts: 77
Joined: Thu Aug 09, 2007 9:42 pm

Pet mana regen

Post by Hrnac »

Red Squirrel wrote:Which mob types exactly? All my tests show that they're regening mana very fast (mobs regen faster then players). And for the players having issues, what gender, race, and what skills?

These mana issues are mind boggling, since everything works fine for all tests that I do.
Male Human char

Skills: Magery 100, Eval int. 100, Inscription 100, Meditation 92

Still gaining 1 point every 9-10 seconds.

-Hrnac

Archived topic from AOV, old topic ID:1101, old post ID:7259
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

Pet mana regen

Post by dprantl »

Oh that's interesting... with my player char with 80 med, if I take off all my mana regen stuff I regen mana like 1 per 10 seconds. As soon as I put on anything with mana regen, it gets much faster...

That's probably why mobs are so slow, because they do not wear any MR stuff. So it seems that item MR and med are somehow linked and when you made the change to regens it somehow threw the system out of whack.

Archived topic from AOV, old topic ID:1101, old post ID:7261
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Pet mana regen

Post by Red Squirrel »

Yeah which makes no sense, this is the actual code:

Code: Select all

				double medPoints = from.Int + ((from.Skills[SkillName.Meditation].Value*1.5) * 3);

				medPoints *= ( from.Skills[SkillName.Meditation].Value < 100.0 ) ? 0.025 : 0.0275;

				CheckBonusSkill( from, from.Mana, from.ManaMax, SkillName.Focus );

				double focusPoints = (int)((from.Skills[SkillName.Focus].Value*1.5) * 0.05);

				if ( armorPenalty > 0 )
					medPoints = 0; // In AOS, wearing any meditation-blocking armor completely removes meditation bonus

				double totalPoints = ScaleRegen(AosAttributes.GetValue( from, AosAttribute.RegenMana )) +
					focusPoints + medPoints + (from.Meditating ? (medPoints > 13.0 ? 13.0 : medPoints) : 0.0);

				if ( CheckTransform( from, typeof( VampiricEmbraceSpell ) ) )
					totalPoints += 3;
				else if ( CheckTransform( from, typeof( LichFormSpell ) ) )
					totalPoints += 13;

				if ( (from is BaseCreature && ((BaseCreature)from).IsParagon) || from is Leviathan )
					totalPoints += 40;

				if ( totalPoints < -1 )
					totalPoints = -1;

				rate = 1.0 / (0.1 * (2 + (int)totalPoints));
The only thing that was changed was adding the scaleregen, which only affects items, and timing the skill by 1.5.

Archived topic from AOV, old topic ID:1101, old post ID:7262
Honk if you love Jesus, text if you want to meet Him!
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

Pet mana regen

Post by dprantl »

Hmm, there seems to be lots of multiplying going on there... could it be that one of the values is now 0 when not wearing any items, causing the regen equation to always equal 0?

Archived topic from AOV, old topic ID:1101, old post ID:7264
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

Pet mana regen

Post by dprantl »

Yes, but the weirdest thing is that I simply cannot reproduce this stuff on the test server either...

Archived topic from AOV, old topic ID:1101, old post ID:7266
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Pet mana regen

Post by Red Squirrel »

Yeah I was thinking that, but even then, the ScaleRegen(AosAttributes.GetValue( from, AosAttribute.RegenMana )) part is simply added on to the rest of the calculation, and its always been 0 on mobs.

I have a feeling its some kind of difference between AMD and Intel calculations at the cpu level, or maybe even a clock tick issue, depending on how C# handles timers. Its beyond a script issue, otherwise the problem would be happening on the test shard too.

Archived topic from AOV, old topic ID:1101, old post ID:7267
Honk if you love Jesus, text if you want to meet Him!
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

Pet mana regen

Post by dprantl »

Ok, so looking at that code, the only thing that could possibly be causing the current effects would be the ScaleRegen part. I can't explain why it's doing it on the live server and not on the test server, but I bet if you removed that statement from the totalPoints generation, the problem would go away on the live server.

Maybe that ScaleRegen call returns a huge negative number on the different CPU when AosAttribute.RegenMana = 0, but lower down anything that's more negative than -1 is set to -1. If it's greater than 0, then everything works as it should...

Archived topic from AOV, old topic ID:1101, old post ID:7270
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Pet mana regen

Post by Red Squirrel »

Yeah maybe, intel has a hisory of floating point issues.... LOL

I added an if statement to check if its negative, if it is, then it returns 0.

Archived topic from AOV, old topic ID:1101, old post ID:7272
Honk if you love Jesus, text if you want to meet Him!
User avatar
Hrnac
Posts: 77
Joined: Thu Aug 09, 2007 9:42 pm

Pet mana regen

Post by Hrnac »

I am happy to report that my chars mana regen rate appears to be working properly.

-Hrnac

Archived topic from AOV, old topic ID:1101, old post ID:7284
Bashir
Posts: 19
Joined: Sat Jan 13, 2007 2:53 pm

Pet mana regen

Post by Bashir »

I was actually going to post about this but I just rechecked and now my char is regen'ing properly. Before, even in lich form he wouldn't get more than one point even 5 seconds. Good job guys :D

Archived topic from AOV, old topic ID:1101, old post ID:7287
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Pet mana regen

Post by Red Squirrel »

Must of been the amd/intel thing then. intel sucks at floating point instructions. :P (test server is amd)

Archived topic from AOV, old topic ID:1101, old post ID:7292
Honk if you love Jesus, text if you want to meet Him!
Locked