Some stuff
Gonna try to keep most of my future small posts in this thread to avoid my name over-running the development forum.
Was rather quiet in IRC tonight so I'm gonna post the ideas I came up with tonight. Looking at the recourse code and something seems not quite right with it, I use a SK for testing a lot and noticed torrent of pain doesn't hit either my self or my group, I think it's because of how the target types are done with the recourse code. Also I think it's not well placed in the casting sequence; the recourse code is put in before the resist check so even if your target resists the spell the recourse will still go off and this seems wrong to me. Reference Spells: http://lucy.allakhazam.com/spell.html?id=2486 Group v1 (ST_GroupTeleport) http://lucy.allakhazam.com/spell.html?id=2480 Group v1 (ST_GroupTeleport) Recourse was in Mob::SpellFinished(): at the top: Code:
int recourse_spell=0; Code:
// Recourse means there is a spell linked to that spell in that the recourse spell will First I'd move it down to spellontarget() I suppose, right after the resist check to make sure the spell landed before the recourse goes off. Then I'd change the code a bit to be something like: Code:
// Recourse means there is a spell linked to that spell in that the recourse spell will you'll find the lines Code:
if (realTotal > 0 && UsedItem) { Code:
if (realTotal > 0 && UsedItem && spells[spell_id].buffduration == 0) { Also I noticed in the last version I pulled up from source the first few lines in Client::Attack() remained unchanged despite what the changelog says. Really I think the first log statement needs to be changed because of it's potential to cause a crash. Code:
bool Client::Attack(Mob* other, int Hand, bool bRiposte) Code:
bool Client::Attack(Mob* other, int Hand, bool bRiposte) Also in Client::Message() Code:
void Client::Message(uint32 type, const char* message, ...) { Don't have time to compile and test this stuff tonight, I'll try to get around to it tomorrow but in the mean time if you see anything wrong with my ideas feel free to let me have it. |
Got a little work done tonight, nothing I wrote about above, was more looking at the endurance implementation. Some things:
The calc max endurance formula used is wrong, while trying to simplify it certainly makes it easier to read it also leads it to some pretty bad rounding errors. My warrior lost a good 800 endurance with your simplified version. This is the new version I wrote that didn't use non standard min/max() and added in commenting so the logic is understandable Code:
//Info taken from magelo, it's a *little* off but accurate enough. Sarrie 65 War naked http://i8.photobucket.com/albums/a2/...rite/naked.jpg Sarrie 65 War with her full gear on http://i8.photobucket.com/albums/a2/...e/notnaked.jpg It appears almost like itembonuses are being counted twice serverside. Ex. Sarrie had +86 wisdom fully geared and had a base of 70 shoulda been 156 serverside like clientside but was 242. 70 + (86*2) = 242. And obviously stats aren't capped correctly which is gonna mess with hp/mana/endurance calculations, among other things. Not exactly sure what causes it though. Also though I haven't gotten around to testing it I'm pretty sure this is the case: In the itemfield encoding for titanium I believe Code:
/* 083 */ I(AugSlotType[0]) I'll try to look into all this a little bit more and get some more info. |
Code:
//Info taken from magelo, it's a *little* off but accurate enough. The double stats comes from functions that use the Mob::Get<somestat>() that instead of return <somestat>; return <somestat> + itembonuses.<somestat> + spellbonuses.<somestat>. Not what solution there would be other than making sure code that involves clients uses client::getstat instead of mob::getstat in the code, which will probably be a little tedious given the amount of times they're referenced. The aug thing, I'm not sure how they're serialized in the code yet so take that with a grain of salt but I confirmed when I set in the database: augslottype1 = 0; augslot1unk = 7; That I created an item with an aug slot of 7 clientside, trying to apply it to an item was a little troublesome. I successfully inserted the augment into the item, however after you finish the insert the items in the pool are not deleted immediatly and attempting to remove them causes the client to crash, so obviously some work to be done there. The glow message thing appears to work, and tested recourse; took out old recourse code and replaced it with this in spellontarget rightbelow where resists are calculated. Code:
if(spell_effectiveness == 100) |
Now some actual changes:
-Fixed the atk mlog bug, again. -Changed how recourse works -Made glow messages only go off for instant spells -Changed how haste is calculated to account for caps and stacking correctly and to make sure we account for overhaste spells(ex warsong of the vahshir). Should fix one of the current dev issues with wonderous rapidity and nature's melody etc etc. -The way hundredhands is calculated isn't correct, but I wasn't sure how to address it so I kept it the way it was implemented for now but replacing the true/false with actual effect values. -Changed the end calculations slightly (but in a big way) GetLevel()*0.075 is added in every line to address some pretty massive rounding errors if you try to simplify it, we're talking a loss of 8-900 endurance when you get up in pop gear kinda rounding errors. -Special Messages should be able to show a type other than 0x0A. And svn created me a nifty little patch file http://hmproject.org/files/haste.patch |
Another quick change. Did this pretty quickly so tell me if I messed any part of it up.
Dunno if it bothers anyone else as much as it bothers me but the small quickly used timers for the hard coded client skills keep bugging out on me, my sneak is down for the next 11 days according to my database for instance =( Not sure at all what causes these short timers to bug out so I added a rule here on whether or not to enforce them, I mean do we really need to enforce them? They're hard coded into the client and it's going to be pretty rare that someone hacks into the client to change the timers, most are only a few seconds anyway. Also threw in another rule that helps server admins modify the endurance regen since there really isn't any way to raise your regen outside of +endurance regen items, and def seems like something admins might want to change, just like an exp modifier. new rules: RULE_BOOL( Character, EnforceSkillTimers, false ) RULE_REAL( Character, EnduranceRegenBonus, 1.0 ) http://hmproject.org/files/timers.patch Also would like to add that I love this rule system, it's a brilliant concept. |
People will hack the client for the timers, trust me. Instant Back Stab for instance.
This was added in because of the amount of people that were hacking the client. |
I love you man!
These are some seriously bad-ass fixes. I'm gonna patch up the server and see the changes. Will report back if I see something out of the ordinary. :) Keep up the awesome work! |
I'll look for what's happening to the shorter timers, I don't notice it happening with any of the longer ones, my disc timers for instance but it's certainly happening with some of the shorter ones kick sneak hide Feign. That's just there till I figure it out.
Edit: Alright, here's something I found with persistant timers, first I misread the timer in my database last time that led me to the rule conclusion it was really set to 0, 0. If a timer is set to duration 0, enable 0 in the database it wont count as expired, and apparently sometimes when removing timers instead of them being removed from the DB they get set to 0, 0 thus that skill is now bugged for that character(gg). Not sure of a fix yet but yeah thanks for not letting me take the lazy way out with my rule I guess. |
overall the changes look good.
make sure you default any new rules to how they were before you added the rule... aka EnforceSkillTimers to true. interesting about the item bonuses being counted twice... have you checked #showbuffs to see how it compares? also in the endurance calculation, what I put in should have matched your original version here: http://www.eqemulator.net/forums/showthread.php?t=21661 I am assuming that the int() operators in your original code were being used in place of floor()... but in any light, the 0.075 * GetLevel() in your oringinal code was outside the int(), so it should have had the same rounding effects as my code. If you are really not intending to floor() those numbers, than instead of multiplying out each time like you did, just change the variables in that function to be floats and then use max_end += bonus_sum * GetLevel()*0.075; at the end. (converting an int to a float or vise versa is generally a rather computationally expensive operation, and should be minimized) |
I think I've found the issues that affect timers. A timer that is not enabled and as a 0 duration will return false on get expired and never be cleared from the database, sometimes they do(I dunno why? but can we put a work around in the expired code?).
Also some of the hard coded combat skills are affected by haste clientside but not taking that into account server side. Ex just timed my backstab clientside with a stopwatch, about 8 seconds without haste 5.5 with. The issues with get stats is it uses the Mob:: version of stats instead of Client:: we need to be very careful as a result when things can be both for clients and npcs. Get stats for instance uses the mob version and the mob version counts the item and spell bonuses twice for clients because they aren't counted at all for non clients outside of that. I'm not sure what's with my head and the endurance sorry, I really had documented a major loss in it the other day but just went to go make sure I wasn't crazy and apparently I am, oh no =( I work too late, sorry mate, if I actually find the problem again I'll bring it back to you in excrutiating detail. I'm editing this post way too much but yeah also I'm gonna go through and see about getting close to the actual times on the client side skills since some seem off, some by a lot(track/forage!). |
Alright after being informed last night how common the hackers were I looked into the timers further. Instead of the enforce rule I did this.
Checks to see if the timer is enabled where we check to see if timers are expired ex: Code:
- if(!p_timers.Expired(&database, pTimerCombatAbility, false)) { Also applied haste to the timers for combat, tested it somewhat and seemed to work fine. http://hmproject.org/files/timers2.patch |
Notice you redid some of the special attack code to be more consistant with regular attacks. Looking over it I saw a few things, not really much from what you changed but what was already there in the orig. design.
In avoid damage there are several calls to functions Mob::CanThisClass<Whatever>() that always return false for npcs meaning they never dodge parry riposte except under certain conditions. Example: Code:
bool Mob::CanThisClassParry(void) const Code:
bool Mob::CanThisClassParry(void) const I also question how we do the input damage to that code with regards to AC mitigation. What we do now is take a random number from the min and max hit in terms of combat and then throw that into the avoid damage which has a sort of confusing mitigation formula and this gives us an illusion of real AC mitigation with the random numbers being spit out at us. Really though we should be throwing in the max value and the mitigation should be throwing us back a new value that seems random based on our pure AC from items and our attackers str+atk+offense_skill, then checking the out number versus the min hit we can make. Then there's also critical hits, currently nothing but auto attack can crit, and the code really just makes the attack() function look messy. Special attacks should be able to crit too so what if we had something like this that we could throw in after every time we do anything with melee: Code:
void Mob::CriticalHit(Mob* defender, int16 skillinuse, sint32 &damage) |
I have always thought that the whole enabled/disabled concept was strange for ptimers. I think the best solution for them is to completely remove the concept... either they exist and are running, or they do not exist.
good eye on the CanThisClass* stuff. as for mitigation, basically it isnt implemented for shit because nobody has been able to find reliable equations for it. as for the special attacks/riposte stuff, we can keep patching the holes, and end up with a duplicate of Client::Attack(), but really we just need to refactor the attack functions to support special attacks, etc such that we are not duplicating code. I took the special attack code about as far as I thought was reasonable before crossing into duplication land. I think the crit function looks reasonable, I would rename it to TryCriticalHit. |
I've come up with what I think is a reasonable AC mitigation formula but I'm still tweaking it, I have a question though, I'm using extensive rules in it as part of the tweaking so I don't have to recompile to push a value up or down a point or two, is the overhead low enough with rules that this is okay?
Example I'm using about oh: RULE_INT( Combat, TankACModifier, 14 ) RULE_INT( Combat, MediumTankACModifier, 11 ) RULE_INT( Combat, LightTankACModifier, 9 ) RULE_INT( Combat, PureCasterACModifier, 6 ) RULE_INT( Combat, IksarACModifier, 1 ) RULE_INT( Combat, NPCACModifier, 10 ) RULE_INT( Combat, AttackCalcModifier, 9 ) RULE_INT( Combat, ACBase, 65 ) RULE_INT( Combat, RollDiffACMod, 6 ) RULE_INT( Combat, RollDiffLevelMod, 5 ) all those per AvoidDamage call, some more than once, is there going to be some kind of speed hit where I should hard code those values in the end or is using the rules fine? The crit function seems the most reasonable solution to me since it can later be expanded to let NPCs crit under certain circumstances, via crit buffs or pets if their owners have petcrit AAs etc; as well as being easily plugged into the special attack code. |
Some more stuff. Mostly aggro changes and one change to corpses.
Adds Rules: RULE_INT (Spells, SpellAggroModifier, 100) % Aggro spells generate 100% default RULE_INT (Spells, BardSpellAggroMod, 3) Bard Aggro From Spells / BardSpellAggroMod RULE_INT (Spells, PetSpellAggroMod, 10) Pet Aggro From Spells / PetSpellAggroMod Today was the first time I dual-boxed since I did corpses which is why I didn't really see this earlier. Was testing my AC mitigation and heal aggro and thought this was fixed. There's this is Client:: Death() Code:
entity_list.AddCorpse(new_corpse, GetID()); Code:
entity_list.AddCorpse(new_corpse, GetID()); http://hmproject.org/files/Aggro.patch I surely hope some of my previous changes make it in, I notice some haven't yet. Really think haste affecting combat timers, change to how haste is calculated, recourse and glow messages are nice changes. Also have been working on Mitigation recently as we don't really have any real mitigation to speak of. Here's the formula I'm working with atm: Code:
RULE_CATEGORY ( Combat ) But for anyone who's interested a parse as of last night: http://hmproject.org/files/parserogue.txt Moderatly High AC Mob with a rogue with just under 300str and not much +atk. OH before I forget: Both the GetAC() and GetATK() are unsigned int values but can attempt to return signed values. Ex with an AC debuff on you can get -100 AC and it will try to return -100 AC but the return type is unsigned = bad stuff. |
All times are GMT -4. The time now is 03:27 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.