LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
295 stars 593 forks source link

Summoner's Doublet not working #778

Closed Skerxan closed 3 years ago

Skerxan commented 3 years ago

Additional Information (Steps to reproduce/Expected behavior) :

Depending on day: Avatar perpetuation cost -3 is currently not working on Summoner's Doublet and probably its variants.

Tested with Garuda on Windsday.

Abbvreviated name: summoners_dblt. Item ID: 15101

https://www.bg-wiki.com/ffxi/Summoner's_Dblt.

zach2good commented 3 years ago

Everything seems like it should work, here are the areas for someone to investigate:

item_mods.sql

INSERT INTO `item_mods` VALUES (15101,5,20);      -- MP +20
INSERT INTO `item_mods` VALUES (15101,357,3);     -- Blood Pact ability delay -3
INSERT INTO `item_mods` VALUES (15101,373,3);     -- Depending on day: Avatar perpetuation cost -3

Seems OK -> note mod number: 373

Looking up 373 -> DAY_REDUCTION https://github.com/LandSandBoat/server/blob/109c9e2ab1195f43996a5ebc9accb74ceb3f5dd9/src/map/modifier.h#L451

Leads to charutils::AvatarPerpetuationReduction(CCharEntity* PChar): https://github.com/LandSandBoat/server/blob/01e16707b6a54e54fd111c18d063b0f67e551f1a/src/map/utils/charutils.cpp#L5137-L5166

If I had to guess, about a year ago we had a big shuffle of elements, elemental days, avatar and spell elements etc (spoiler alert: they don't all line up...) and they have probably fallen out of sync. if (battleutils::GetDayElement() == element)

I think that Firesday (the first day) always lines up with Fire as an element, so you might be able to test and see if it works on that day. Garuda+Wind is in the middle of the list and might be shuffled...

RAIST5150 commented 3 years ago

Should be lightsday/darksday when I get home tonight, so can check at least one of those days near the end of the cycle tonight.

Skerxan commented 3 years ago

Fenrir on Darksday also doesn't work so far.

zach2good commented 3 years ago

Confirmed my theory: Garuda's element in pet_list.sql is 3.

battleutils::GetDayElement() on Windsday is NOT 3: https://github.com/LandSandBoat/server/blob/base/src/map/utils/battleutils.cpp#L5376-L5399

zach2good commented 3 years ago

Oops, maybe it is: https://github.com/LandSandBoat/server/blob/2dbae3a1d7e3de544670f35051620660d5f9205f/src/map/utils/battleutils.h#L84-L95

RAIST5150 commented 3 years ago

Hrm... that is a bit of a pickle, eh? Guessing a couple may be out of whack... all because SE put the days out of synch with elemental wheel?

zach2good commented 3 years ago

Perhaps element is incorrectly shifted by one, by us? uint8 element = ((CPetEntity*)(PChar->PPet))->m_Element - 1;

Skerxan commented 3 years ago

Just tested Ifrit on Firesday. Still a no go.

RAIST5150 commented 3 years ago

May be a good idea to check all avatars to see which it is actually getting reduction?

zach2good commented 3 years ago

Looking suspiciously like an off-by-one error, we already do a +1 adjustment to something else in that same method:

        if (battleutils::GetDayElement() == element)
        {
            reduction = reduction + PChar->getMod(Mod::DAY_REDUCTION);
        }

        WEATHER weather = battleutils::GetWeather(PChar, false);

        if (weather == weatherStrong[element] || weather == weatherStrong[element] + 1)
        {
            reduction = reduction + PChar->getMod(Mod::WEATHER_REDUCTION);
        }
RAIST5150 commented 3 years ago

Thought just hit me... pets are aligned according to elemental wheel in a sort of reverse order fire (1) >ice(2), etc.

But days don't follow that pattern... wondering if this could wind up having an impact for elemental magic and weaponskill as well?

Fire, ice, wind, earth, thunder, water, light, dark (1-8)

But days of week follow: Fire, earth, water, wind, ice, thunder, light, dark

If it indexes in that order as 1-8, that would be a mess.

Skerxan commented 3 years ago

That would be pretty big if that's the case.

RAIST5150 commented 3 years ago

Bleh... brain fart. Haven't farmed any Dynamis stuff here yet. Also can't build Caller's pieces yet so can't check against that set's half reduction either.

Just a reminder, be wary of things like set bonuses and such when looking closer at this. Perhaps go outside of town in just the PJ's and swap only the body on/off.

Case in point, keep thinking my elementals are free, but it is more because I am taking damage that is converting to MP. Doesn't take much to offset just 1mp/tick.

TeoTwawki commented 3 years ago

so much for the whole attempt to unify ele order handling if we can't even tell if its right or not

I've got reports from players that other things relying on day order are coming out wrong: off by 1 or straight backwards

[7:07 PM] Rheine: There are some problèms with avatar perp cost with ele staves. Ex: garuda @13 with refresh 5 -4 perp cost (HQ wind ele staff). But leviathan has à perp cost of 4 with same gear. Should be opposite.

but then:

Titan has à perp cost of 9 with that gear but à perp of 10 if i remove staff. Its really weird...

also got reports that day bonus/penalty on spells is happening on incorrect days, but can't prove it because I am not sitting in game to try it myself

rheinecatsin commented 3 years ago

So I used to play with smn alot. Things were normal under dsp. Just gave it a try last night. The elemental wheel really is a mess, and not just regarding days.

Elemental staff are all wrong. I have a +3 mp perp cost summoning garuda with HQ wind staff hile it should be -3. But Leviathan has the -3. I think titan was at -1. Same with thunder spirit and HQ thunder staff, +3 perp cost. Quick way to find actual elemental wheel would be to try each avatars with each staff and see which are at +3 (+2 NQ) and which at -3 (-2) to find matched elements and opposite elements.

RAIST5150 commented 3 years ago

Can test the staves easily enough when I get home in about 4 hours. Only HQ I don't have is ice so far (shortage of ice ores/beads for the crafters).

zach2good commented 3 years ago

Working on this here: https://github.com/LandSandBoat/server/pull/785

RAIST5150 commented 3 years ago

Cool. Wound up working late... just now got home and checked elementals/avatars against Apollo's real quick. Perp. Cost appears to be in check against that one at least. Will walk through the others after I eat some lunch just to have it noted somewhere if something is indeed off, in case it is still needed.

A bit curious about Teo's comment concerning elemental magics. Testing staff bonus should be easy enough to verify... but that day/weather question. Haven't made any obi's yet... though I do have some organs already. Unless you think the work in that PR could tie into elemental magic/weapon skills too?

RAIST5150 commented 3 years ago

Ok... ice staff and the remaining HQ elemental staff perpetuation cost effects appear to be inline. Don't have fire and thunder spirit or avatars past Diabolos/Fenrir yet, but all others responded properly.

So long as elemental magic and WS are playing by the same structure when it comes to elemental affinity on that front, we should be OK.

That just leaves the day/weather impacts, which Zach is already refactoring perp. cost to correct that angle.

TeoTwawki commented 3 years ago

Unless you think the work in that PR could tie into elemental magic/weapon skills too?

I think if it doesn't turn out to be some super obvious mistake in the ordering of elements then its probably players eyeballing damage trying to explain low rolls and how it "feels" like that's more often than they expect. coz random number jebis hates mages, I guess. But I can't rule out or confirm anything atm so given we were seeing similarly elemental order related things felt I should mention in case they all lead back to the same problem.

zach2good commented 3 years ago

In general, if you encounter something: raise an issue.

It took me 5 minutes to find and fix, but we can't fix what we don't know about.

On Tue, Oct 19, 2021, 22:24 TeoTwawki @.***> wrote:

Unless you think the work in that PR could tie into elemental magic/weapon skills too?

I think if it doesn't turn out to be some super obvious mistake in the ordering of elements then its probably players eyeballing damage trying to explain low rolls and how it "feels" like that's more often than they expect. coz random number jebis hates mages, I guess. But I can't rule out or confirm anything atm so given we were seeing similarly elemental order related things felt I should mention in case they all lead back to the same problem.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LandSandBoat/server/issues/778#issuecomment-947037278, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKTJIJJO75ZIRHVFYGKNKDUHXAXVANCNFSM5GGNDYRQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

TeoTwawki commented 3 years ago

it does look like something is up with weather:

WEATHER strongWeatherSingle[8] = { WEATHER_HOT_SPELL, WEATHER_SNOW, WEATHER_WIND, WEATHER_DUST_STORM,WEATHER_THUNDER, WEATHER_RAIN, WEATHER_AURORAS, WEATHER_GLOOM };
WEATHER strongWeatherDouble[8] = { WEATHER_HEAT_WAVE, WEATHER_BLIZZARDS, WEATHER_GALES, WEATHER_SAND_STORM,WEATHER_THUNDERSTORMS, WEATHER_SQUALL, WEATHER_STELLAR_GLARE, WEATHER_DARKNESS };
WEATHER weakWeatherSingle[8]   = { WEATHER_HOT_SPELL, WEATHER_SNOW, WEATHER_WIND, WEATHER_DUST_STORM,WEATHER_THUNDER, WEATHER_RAIN, WEATHER_GLOOM, WEATHER_AURORAS };
WEATHER weakWeatherDouble[8]   = { WEATHER_SQUALL, WEATHER_HEAT_WAVE, WEATHER_BLIZZARDS, WEATHER_GALES,WEATHER_SAND_STORM, WEATHER_THUNDERSTORMS, WEATHER_DARKNESS, WEATHER_STELLAR_GLARE };

https://github.com/LandSandBoat/server/blob/base/src/map/utils/battleutils.cpp#L509

element orders on single and double weak should match, instead one starts fire and one starts fire. looks like copy pasta error. I don't see anything in day stuff that would mess up nukes though. just weather. Actually I'm still not sure what this affects: pretty sure the magic damage math all happens lua side anyway?

TeoTwawki commented 3 years ago

In general, if you encounter something: raise an issue. It took me 5 minutes to find and fix, but we can't fix what we don't know about.

True but I also don't want to waste your time with a wildgoose chase so I didn't say anything immediately (for whats its worth, only been like 1 week since someone told me it "seems like" they get resisted on the wrong day/weather..and I don't report feelings)

zach2good commented 3 years ago

I mean, the assumption is that some level of repeated testing and analysis would happen first, rather than opening an issue every time your magic burst is lacklustre on the third Tuesday of the month when Venus is in retrograde

On Tue, Oct 19, 2021, 22:38 TeoTwawki @.***> wrote:

In general, if you encounter something: raise an issue. It took me 5 minutes to find and fix, but we can't fix what we don't know about.

True but I also don't want to waste your time with a wildgoose chase so I didn't same anything immediately (for whats its worth, only been like 1 week since someone told me it "seems like" they get resisted on the wrong day/weather..and I don't report feelings)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LandSandBoat/server/issues/778#issuecomment-947046504, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKTJIJIZ4Q2BGU2QCLHTBLUHXCM7ANCNFSM5GGNDYRQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

TeoTwawki commented 3 years ago

@zach2good you forgot to face north and emote to odin first. thats how you HQ burst

TeoTwawki commented 3 years ago

made #788 to deal with that weather order, but I do not know what all is impacted as lua appears to have its own arrays of elements for magic casts.

RAIST5150 commented 3 years ago

Think it may indeed be something up with resist rates on the elemental magic front.

RNGesus has always had a tendency to get quite brutal sometimes. But this may be something different....

Just for sh!ts and giggles, since it was approaching the end of ice day, I stripped down to just YY robe and ran out as SMN/BLM to fart around a bit.

Wow... what a difference it made when it flipped to lightningsday.

Was definately getting boosts on iceday... but something weird was going on for sure.

On ice day the resistance rates were brutal. Most were "minor" penalties... but the resists seemed to occur quite regularly--even ones down to 50% territory. It made it feel like my stats were suddenly nowhere near being "floored", resulting in some funky spike/dip cycles I did NOT expect to see.

Resists suddenly seemed to vanish once it flipped to lightning day. Same mobs, same staff, same spell--but the damage numbers remained the same for each mob type. The result was no more "spike damage" feeling, and virtually no more 50% resists.

Granted, this is a small pool of numbers... but makes me wonder if there may be an exception issue with math that goes out of bounds on the high end?

Continued running around a bit more while still lightning day. Ice staff, ice spells remained mostly consistent (maybe a 10% variance)... but Jupiter with thunder spells were all over the map like it was with ice setup on ice day.

This may well be what people were experiencing... something skewing the resist rates when they try aligning to day/weather. The damage boost appears to be in order... but the rate for resists seems to ramp up.

Xaver-DaRed commented 3 years ago

It doesnt help everything is divided between lua and core. For all we know, we could be duplicating calculations, both times in different places and both wrong.

Fire is the only solution.

RAIST5150 commented 3 years ago

OMG... there is NO way I could make this happen on purpose. Think this may be why people were saying something to Teo.

For the conspiracy folks: about 1900, lightning day, approaching full moon, facing South, only Jupiter Staff and YY robe on 99 SMN/BLM, just outside Bastok Mines. Cast Thunder on two bats back to back, and look what the log showed:

Raist_2021 10 19_163249