Project-Diablo-2 / BH

A modified version of slashdiablo's BH for Project Diablo 2
GNU Affero General Public License v3.0
24 stars 25 forks source link

Added rollback skills to IAS breakpoint calc #22

Closed fergushev closed 1 year ago

fergushev commented 1 year ago

This first pass supports Strafe, Fend, Zeal, and Dragon Talon. Fury requires Druid wereform updates (their IAS works differently from normal)

Some notes from my testing:

So the total number of frames in the animation doesn't change, but the first hit happens a frame sooner.


This is the code I used for testing. I put it inside of MapNotify::OnDraw() since it's always looping. It'll print out the frames only when using specific animations (otherwise you just get spammed with idle and running animation frames)

int previousFrame = -1;

    std::string animName = player->pGfxAnimData->szAnimDataName;
    if (player->pGfxAnimData && 
        (animName == "AMA1BOW" || animName == "40S3HTH" || animName == "40A1HTH" || animName == "40A2HTH" || animName == "AMA1XBW"
            || animName == "PAA11HS" || animName == "AMA12HT" || animName == "AIKKHT1"))
    {
        if (player->dwGfxFrame != previousFrame)
        {
            if (player->bActionFrame)
            {
                PrintText(4, "dwGfxFrame:%i actionFrame:%i rate:%i", player->dwGfxFrame, player->bActionFrame, player->wFrameRate);
            }
            else
            {
                PrintText(1, "dwGfxFrame:%i rate:%i", player->dwGfxFrame, player->wFrameRate);
            }
            previousFrame = player->dwGfxFrame;
        }
    }

Here's another example with Zeal at the fastest breakpoint: image (end wall-of-text)

fergushev commented 1 year ago

Sequence frame test code:

int previousSeqFrame = -1;

        std::string animName = player->pGfxAnimData->szAnimDataName;
    if (player->nSeqFrame &&
        (animName == "BAGH1ST" || animName == "BAGH1JS" || animName == "BAGH1JT"))
    {
        if (player->nSeqFrame != previousSeqFrame)
        {
            if (player->bActionFrame)
            {
                PrintText(4, "nSeqFrame:%i actionFrame:%i rate:%i", player->nSeqFrame, player->bActionFrame, player->wFrameRate);
            }
            else
            {
                PrintText(1, "nSeqFrame:%i rate:%i", player->nSeqFrame, player->wFrameRate);
            }
            previousSeqFrame = player->nSeqFrame;
        }
    }