NoCode-NoLife / melia

Open-Source MMORPG Server Emulator
GNU General Public License v3.0
264 stars 93 forks source link

Monster Attack Skills #288

Closed Terotrous closed 1 week ago

Terotrous commented 1 month ago

Monster attack skills have significant timing issues. It seems like for most monsters, the "time" has been used as the hitdelay, and the "animtime" has been used as the damage delay, but this results in the damagedelay being way too long for almost all skills. It should probably be hittime = time - 50, damagedelay = 50 across the board.

There are also some monsters, like Popolion, where the attack data seems incorrect. In this case, Popolion seems to use the "Popolion_2" attack animation, which has much slower timing than the one currently used in the monster attack file.

exectails commented 1 month ago

I fully agree that the attack times seem incorrect, but unfortunately I don't think they actually are. Looking at official packet logs, we appear to be using the correct hit, damage, and skill delays for Mon_Popolion_Attack. There's a delay of 500ms between ZC_SKILL_MELEE_GROUND and ZC_SKILL_HIT_INFO, and the latter contains a damage delay of 700ms and a skill hit delay of 200ms, same as Melia. I also double checked that our Popolions are in fact using that skill.

That doesn't necessarily mean that nothing is wrong about Melia, there could be factors at play that we don't yet know about, but the raw numbers appear to be correct.

Terotrous commented 1 month ago

Strange. Of course, it's also possible the official is also wrong or just really janky.

There's also an issue regarding monsters getting too close to attack, they should probably use similar triggering logic to the pads to attack immediately once their target is within range of their attack.

exectails commented 1 month ago

That is what they do, though they may accidentally move all the way up to their target if their attack range is very small. We could tweak this a little, though I suspect the main problem is likely the attack range we use.

Terotrous commented 1 month ago

Popolion actually usually moves past you to attack, so there's definitely something a bit funky going on there.

exectails commented 1 month ago

That's actually curious, because monsters are set to walk predicisely to the target's location while they're not in attacking range. So if you're standing still it should be impossible for them to overshoot.

exectails commented 1 week ago

Since we established that the delay values are correct, which was the original point of this issue, I'm going to close it for now. Any potential AI movement issues would deserve an issue of their own, though we since added path finding and this would presumably need a reevaluation.